Skip to content

Commit f5da039

Browse files
authored
Merge pull request #2781 from testssl/ccsInjectionFix_3.0
Fix CCS injection
2 parents 4beed53 + 04e174b commit f5da039

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

testssl.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14239,23 +14239,23 @@ run_ccs_injection(){
1423914239
else
1424014240
fileout "$jsonID" "OK" "not vulnerable" "$cve" "$cwe"
1424114241
fi
14242-
elif [[ "${tls_hello_ascii:0:4}" == "1503" ]]; then
14243-
if [[ ! "${tls_hello_ascii:5:2}" =~ 03|02|01|00 ]]; then
14242+
elif [[ "${tls_hello_ascii:0:4}" == 1503 ]]; then
14243+
if [[ ! "${tls_hello_ascii:4:2}" =~ 03|02|01|00 ]]; then
1424414244
pr_warning "test failed "
1424514245
out "no proper TLS reply (debug info: protocol sent: 1503${tls_hexcode#x03, x}, reply: ${tls_hello_ascii:0:14}"
1424614246
fileout "$jsonID" "DEBUG" "test failed, around line $LINENO, debug info (${tls_hello_ascii:0:14})" "$cve" "$cwe" "$hint"
1424714247
ret=1
14248-
elif [[ "$byte6" == "15" ]]; then
14248+
elif [[ "$byte6" == 15 ]]; then
1424914249
# decryption failed received
1425014250
pr_svrty_critical "VULNERABLE (NOT ok)"
1425114251
fileout "$jsonID" "CRITICAL" "VULNERABLE" "$cve" "$cwe" "$hint"
14252-
elif [[ "$byte6" == "0A" ]] || [[ "$byte6" == "28" ]]; then
14252+
elif [[ "$byte6" == "0A" ]] || [[ "$byte6" == 28 ]]; then
1425314253
# Unexpected message / Handshake failure received
1425414254
pr_warning "likely "
1425514255
out "not vulnerable (OK)"
1425614256
out " - alert description type: $byte6"
1425714257
fileout "$jsonID" "WARN" "probably not vulnerable but received 0x${byte6} instead of 0x15" "$cve" "$cwe" "$hint"
14258-
elif [[ "$byte6" == "14" ]]; then
14258+
elif [[ "$byte6" == 14 ]]; then
1425914259
# bad_record_mac -- this is not "not vulnerable"
1426014260
out "likely "
1426114261
pr_svrty_critical "VULNERABLE (NOT ok)"
@@ -14268,7 +14268,7 @@ run_ccs_injection(){
1426814268
out ", suspicious error code \"$byte6\" returned. Please report"
1426914269
fileout "$jsonID" "CRITICAL" "likely VULNERABLE with $byte6" "$cve" "$cwe" "$hint"
1427014270
fi
14271-
elif [[ $STARTTLS_PROTOCOL == "mysql" ]] && [[ "${tls_hello_ascii:14:12}" == "233038533031" ]]; then
14271+
elif [[ $STARTTLS_PROTOCOL == mysql ]] && [[ "${tls_hello_ascii:14:12}" == 233038533031 ]]; then
1427214272
# MySQL community edition (yaSSL) returns a MySQL error instead of a TLS Alert
1427314273
# Error: #08S01 Bad handshake
1427414274
pr_svrty_best "not vulnerable (OK)"

0 commit comments

Comments
 (0)