Skip to content

Commit 8d4042c

Browse files
authored
Merge pull request #1726 from drwetter/fix_1725_SCIR
Fix Secure Client-Initiated Renegotiation false positive (3.1dev)
2 parents d4a3a67 + ade010d commit 8d4042c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

testssl.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15951,7 +15951,6 @@ run_renego() {
1595115951
;; # all ok
1595215952
esac
1595315953

15954-
1595515954
if "$TLS13_ONLY"; then
1595615955
pr_svrty_best "not vulnerable (OK)"
1595715956
[[ $DEBUG -ge 1 ]] && out ", no renegotiation support in TLS 1.3 only servers"
@@ -15973,7 +15972,14 @@ run_renego() {
1597315972
else
1597415973
# second try in the foreground as we are sure now it won't hang
1597515974
echo R | $OPENSSL s_client $(s_client_options "$proto $legacycmd $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY") >$TMPFILE 2>>$ERRFILE
15976-
sec_client_renego=$? # 0=client is renegotiating & doesn't return an error --> vuln!
15975+
sec_client_renego=$?
15976+
# 0 means client is renegotiating & doesn't return an error --> vuln!
15977+
# 1 means client tried to renegotiating but the server side errored then. You still see RENEGOTIATING in the output
15978+
if tail -5 $TMPFILE| grep -qa '^closed'; then
15979+
# Exemption from above: server closed the connection but return value was zero
15980+
# See https://github.com/drwetter/testssl.sh/issues/1725 and referenced issue @haproxy
15981+
sec_client_renego=1
15982+
fi
1597715983
case "$sec_client_renego" in
1597815984
0) # We try again if server is HTTP. This could be either a node.js server or something else.
1597915985
# node.js has a mitigation which allows 3x R and then blocks. So we test 4x

0 commit comments

Comments
 (0)