Skip to content

Commit 79db276

Browse files
authored
Merge pull request #2982 from testssl/feature_2806
Flag absence of extended master secret extension
2 parents 251d5ac + ca55c5b commit 79db276

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
* QUIC protocol check
77
* TLS 1.3 early data (0-RTT)
8+
* Adds a check for mandatory extended master secret TLS extension
89
* Bump SSLlabs rating guide to 2009r
910
* Check for Opossum vulnerability
1011
* Enable IPv6 automagically, i.e. if target via IPv6 is reachable just (also) scan it

t/32_isHTML_valid.t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ $debughtml =~ s/No engine or GOST support via engine with your.*\n//g;
9696
$debughtml =~ s/.*built: .*\n//g;
9797
$debughtml =~ s/.*Using bash .*\n//g;
9898
$debughtml =~ s/.*has_compression.*\n//g;
99+
$debughtml =~ s/.*Extended master secret extension detected.*\n//g;
99100
# is whole line: s/.*<pattern> .*\n//g;
100101

101102
# Extract and mask IP address as it can change

testssl.sh

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8223,6 +8223,12 @@ determine_tls_extensions() {
82238223
"$SSL_NATIVE" && using_sockets=false
82248224

82258225
if "$using_sockets"; then
8226+
# 01 max_fragment_length, RFC 6066
8227+
# 02 client_certificate_url, RFC 6066
8228+
# 04 truncated_hmac, RFC 6066
8229+
# signed_certificate_timestamp, RFC 6962
8230+
# encrypt_then_mac, RFC 7366
8231+
# extended_master_secret, RFC 7627
82268232
tls_extensions="00,01,00,01,02, 00,02,00,00, 00,04,00,00, 00,12,00,00, 00,16,00,00, 00,17,00,00"
82278233
if [[ -z $STARTTLS ]]; then
82288234
for alpn_proto in $ALPN_PROTOs; do
@@ -10407,6 +10413,7 @@ certificate_info() {
1040710413
return $ret
1040810414
}
1040910415

10416+
1041010417
run_server_defaults() {
1041110418
local ciph newhostcert sni
1041210419
local match_found
@@ -10421,6 +10428,7 @@ run_server_defaults() {
1042110428
local -a -i success
1042210429
local cn_nosni cn_sni sans_nosni sans_sni san tls_extensions extn client_auth_ca
1042310430
local using_sockets=true
10431+
local spaces=" "
1042410432

1042510433
"$SSL_NATIVE" && using_sockets=false
1042610434

@@ -10677,7 +10685,7 @@ run_server_defaults() {
1067710685
pr_headlineln " Testing server defaults (Server Hello) "
1067810686
outln
1067910687

10680-
pr_bold " TLS extensions (standard) "
10688+
pr_bold " TLS extensions "
1068110689
if [[ ${#TLS_EXTENSIONS[*]} -eq 0 ]]; then
1068210690
outln "(none)"
1068310691
fileout "TLS_extensions" "INFO" "(none)"
@@ -10702,6 +10710,28 @@ run_server_defaults() {
1070210710
outln "$tls_extensions"
1070310711
fi
1070410712

10713+
# We want to check whether the (for >=TLS 1.2) mandatory "extended master secret" extension is supported by
10714+
# the server. Otherwise it would violate RFC 9325 https://www.rfc-editor.org/rfc/rfc9325#section-3.5
10715+
# and cause connection problems.
10716+
jsonID="TLS_misses_extension_23"
10717+
if [[ $(has_server_protocol "tls1_2") -eq 1 ]] && [[ $(has_server_protocol "tls1_3") -eq 1 ]] ; then
10718+
:
10719+
elif [[ $tls_extensions =~ \#23 ]]; then
10720+
# Was the last handshake >= TLS 1.2 ?
10721+
if grep -qE 'Protocol.*(TLSv1.3|TLSv1.2)' $TEMPDIR/$NODEIP.parse_tls_serverhello.txt ; then
10722+
fileout "$jsonID" "INFO" "Extended master secret extension detected"
10723+
debugme outln "${spaces}Extended master secret extension detected"
10724+
else
10725+
out "$spaces"
10726+
prln_warning "Fixme: Server supports TLS 1.2 or 1.3 but last ServerHello was < TLS 1.2"
10727+
fileout "$jsonID" "WARN" "Server supports TLS 1.2 or 1.3 but last ServerHello was < TLS 1.2"
10728+
fi
10729+
else
10730+
out "$spaces"
10731+
prln_svrty_medium "No extended master secret extension, violates RFC 9325 & may cause connection problems"
10732+
fileout "$jsonID" "MEDIUM" "No extended master secret extension, violates RFC 9325 & may cause connection problems"
10733+
fi
10734+
1070510735
pr_bold " Session Ticket RFC 5077 hint "
1070610736
jsonID="TLS_session_ticket"
1070710737
if [[ -z "$sessticket_lifetime_hint" ]]; then
@@ -10923,6 +10953,7 @@ run_server_defaults() {
1092310953
return $ret
1092410954
}
1092510955

10956+
1092610957
get_session_ticket_lifetime_from_serverhello() {
1092710958
awk '/session ticket.*lifetime/ { print $(NF-1) "$1" }'
1092810959
}

0 commit comments

Comments
 (0)