|
231 | 231 | DISPLAY_CIPHERNAMES="openssl" # display OpenSSL ciphername (but both OpenSSL and RFC ciphernames in wide mode) |
232 | 232 | declare UA_STD="TLS tester from $SWURL" |
233 | 233 | declare -r UA_SNEAKY="Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0" |
| 234 | +SSL_RENEG_ATTEMPTS=${SSL_RENEG_ATTEMPTS:-6} # number of times to check SSL Renegotiation |
234 | 235 |
|
235 | 236 | ########### Initialization part, further global vars just being declared here |
236 | 237 | # |
@@ -15969,6 +15970,7 @@ run_renego() { |
15969 | 15970 | local cwe="CWE-310" |
15970 | 15971 | local hint="" |
15971 | 15972 | local jsonID="" |
| 15973 | + local ssl_reneg_attempts=$SSL_RENEG_ATTEMPTS |
15972 | 15974 | # No SNI needed here as there won't be two different SSL stacks for one IP |
15973 | 15975 |
|
15974 | 15976 | "$HAS_TLS13" && [[ -z "$proto" ]] && proto="-no_tls1_3" |
@@ -16074,24 +16076,26 @@ run_renego() { |
16074 | 16076 | fi |
16075 | 16077 | case "$sec_client_renego" in |
16076 | 16078 | 0) # We try again if server is HTTP. This could be either a node.js server or something else. |
16077 | | - # node.js has a mitigation which allows 3x R and then blocks. So we test 4x |
| 16079 | + # Mitigations (default values) for: |
| 16080 | + # - node.js allows 3x R and then blocks. So then 4x should be tested. |
| 16081 | + # - F5 BIG-IP ADS allows 5x R and then blocks. So then 6x should be tested. |
16078 | 16082 | # This way we save a couple seconds as we weeded out the ones which are more robust |
| 16083 | + # Amount of times tested before breaking is set in SSL_RENEG_ATTEMPTS. |
16079 | 16084 | if [[ $SERVICE != HTTP ]]; then |
16080 | 16085 | pr_svrty_medium "VULNERABLE (NOT ok)"; outln ", potential DoS threat" |
16081 | 16086 | fileout "$jsonID" "MEDIUM" "VULNERABLE, potential DoS threat" "$cve" "$cwe" "$hint" |
16082 | 16087 | else |
16083 | | - (for i in {1..4}; do echo R; sleep 1; done) | \ |
| 16088 | + (for ((i=0; i < ssl_reneg_attempts; i++ )); do echo R; sleep 1; done) | \ |
16084 | 16089 | $OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY") >$TMPFILE 2>>$ERRFILE |
16085 | 16090 | case $? in |
16086 | | - 0) pr_svrty_high "VULNERABLE (NOT ok)"; outln ", DoS threat" |
| 16091 | + 0) pr_svrty_high "VULNERABLE (NOT ok)"; outln ", DoS threat ($ssl_reneg_attempts attempts)" |
16087 | 16092 | fileout "$jsonID" "HIGH" "VULNERABLE, DoS threat" "$cve" "$cwe" "$hint" |
16088 | 16093 | ;; |
16089 | | - 1) pr_svrty_good "not vulnerable (OK)" |
16090 | | - outln " -- mitigated" |
| 16094 | + 1) pr_svrty_good "not vulnerable (OK)"; outln " -- mitigated (disconnect within $ssl_reneg_attempts)" |
16091 | 16095 | fileout "$jsonID" "OK" "not vulnerable, mitigated" "$cve" "$cwe" |
16092 | 16096 | ;; |
16093 | | - *) prln_warning "FIXME (bug): $sec_client_renego (4 tries)" |
16094 | | - fileout "$jsonID" "DEBUG" "FIXME (bug 4 tries) $sec_client_renego" "$cve" "$cwe" |
| 16097 | + *) prln_warning "FIXME (bug): $sec_client_renego ($ssl_reneg_attempts tries)" |
| 16098 | + fileout "$jsonID" "DEBUG" "FIXME (bug $ssl_reneg_attempts tries) $sec_client_renego" "$cve" "$cwe" |
16095 | 16099 | ret=1 |
16096 | 16100 | ;; |
16097 | 16101 | esac |
|
0 commit comments