@@ -89,10 +89,12 @@ class ServerScanResultIncomplete(Exception):
8989 ScanCommand .HEARTBLEED ,
9090 ScanCommand .ROBOT ,
9191 ScanCommand .OPENSSL_CCS_INJECTION ,
92+ ScanCommand .TLS_FALLBACK_SCSV ,
9293 ScanCommand .TLS_COMPRESSION ,
9394 ScanCommand .SESSION_RENEGOTIATION ,
9495 ScanCommand .CERTIFICATE_INFO ,
9596 ScanCommand .ELLIPTIC_CURVES ,
97+ ScanCommand .TLS_EXTENDED_MASTER_SECRET ,
9698 # ScanCommand.HTTP_HEADERS, # Disabled for now; see below
9799}
98100
@@ -183,9 +185,9 @@ def _check_tls_curves(
183185
184186 tls_curves_difference = supported_curves - mozilla_config .tls_curves
185187 if tls_curves_difference :
186- issues_with_tls_curves [
187- "tls_curves "
188- ] = f"TLS curves { tls_curves_difference } are supported, but should be rejected."
188+ issues_with_tls_curves ["tls_curves" ] = (
189+ f"TLS curves { tls_curves_difference } are supported, but should be rejected. "
190+ )
189191
190192 return issues_with_tls_curves
191193
@@ -198,9 +200,15 @@ def _check_tls_vulnerabilities(scan_result: AllScanCommandsAttempts) -> Dict[str
198200
199201 assert scan_result .openssl_ccs_injection .result
200202 if scan_result .openssl_ccs_injection .result .is_vulnerable_to_ccs_injection :
201- issues_with_tls_vulns [
202- "tls_vulnerability_ccs_injection"
203- ] = "Server is vulnerable to the OpenSSL CCS injection attack."
203+ issues_with_tls_vulns ["tls_vulnerability_ccs_injection" ] = (
204+ "Server is vulnerable to the OpenSSL CCS injection attack."
205+ )
206+
207+ assert scan_result .tls_fallback_scsv .result
208+ if not scan_result .tls_fallback_scsv .result .supports_fallback_scsv :
209+ issues_with_tls_vulns ["tls_vulnerability_fallback_scsv" ] = (
210+ "Server is vulnerable to TLS downgrade attacks because it does not support the TLS_FALLBACK_SCSV mechanism."
211+ )
204212
205213 assert scan_result .heartbleed .result
206214 if scan_result .heartbleed .result .is_vulnerable_to_heartbleed :
@@ -212,9 +220,15 @@ def _check_tls_vulnerabilities(scan_result: AllScanCommandsAttempts) -> Dict[str
212220
213221 assert scan_result .session_renegotiation .result
214222 if not scan_result .session_renegotiation .result .supports_secure_renegotiation :
215- issues_with_tls_vulns [
216- "tls_vulnerability_renegotiation"
217- ] = "Server is vulnerable to the insecure renegotiation attack."
223+ issues_with_tls_vulns ["tls_vulnerability_renegotiation" ] = (
224+ "Server is vulnerable to the insecure renegotiation attack."
225+ )
226+
227+ assert scan_result .tls_extended_master_secret .result
228+ if not scan_result .tls_extended_master_secret .result .supports_ems_extension :
229+ issues_with_tls_vulns ["tls_vulnerability_extended_master_secret" ] = (
230+ "Server does not support the Extended Master Secret TLS extension."
231+ )
218232
219233 return issues_with_tls_vulns
220234
@@ -260,21 +274,21 @@ def _check_tls_versions_and_ciphers(
260274 issues_with_tls_ciphers = {}
261275 tls_versions_difference = tls_versions_supported - mozilla_config .tls_versions
262276 if tls_versions_difference :
263- issues_with_tls_ciphers [
264- "tls_versions "
265- ] = f"TLS versions { tls_versions_difference } are supported, but should be rejected."
277+ issues_with_tls_ciphers ["tls_versions" ] = (
278+ f"TLS versions { tls_versions_difference } are supported, but should be rejected. "
279+ )
266280
267281 tls_1_3_cipher_suites_difference = tls_1_3_cipher_suites_supported - mozilla_config .ciphersuites
268282 if tls_1_3_cipher_suites_difference :
269- issues_with_tls_ciphers [
270- "ciphersuites "
271- ] = f"TLS 1.3 cipher suites { tls_1_3_cipher_suites_difference } are supported, but should be rejected."
283+ issues_with_tls_ciphers ["ciphersuites" ] = (
284+ f"TLS 1.3 cipher suites { tls_1_3_cipher_suites_difference } are supported, but should be rejected. "
285+ )
272286
273287 cipher_suites_difference = cipher_suites_supported - mozilla_config .ciphers .iana
274288 if cipher_suites_difference :
275- issues_with_tls_ciphers [
276- "ciphers "
277- ] = f"Cipher suites { cipher_suites_difference } are supported, but should be rejected."
289+ issues_with_tls_ciphers ["ciphers" ] = (
290+ f"Cipher suites { cipher_suites_difference } are supported, but should be rejected. "
291+ )
278292
279293 if mozilla_config .ecdh_param_size and smallest_ecdh_param_size < mozilla_config .ecdh_param_size :
280294 issues_with_tls_ciphers ["ecdh_param_size" ] = (
@@ -302,9 +316,9 @@ def _check_certificates(
302316 # Validate certificate trust
303317 leaf_cert = cert_deployment .received_certificate_chain [0 ]
304318 if not cert_deployment .verified_certificate_chain :
305- issues_with_certificates [
306- "certificate_path_validation "
307- ] = f"Certificate path validation failed for { leaf_cert . subject . rfc4514_string () } ."
319+ issues_with_certificates ["certificate_path_validation" ] = (
320+ f"Certificate path validation failed for { leaf_cert . subject . rfc4514_string () } . "
321+ )
308322
309323 # Validate the public key
310324 public_key = leaf_cert .public_key ()
@@ -319,9 +333,9 @@ def _check_certificates(
319333 elif isinstance (public_key , RSAPublicKey ):
320334 deployed_key_algorithms .add ("rsa" )
321335 if mozilla_config .rsa_key_size and public_key .key_size < mozilla_config .rsa_key_size :
322- issues_with_certificates [
323- " rsa_key_size"
324- ] = f"RSA key size is { public_key . key_size } , minimum allowed is { mozilla_config . rsa_key_size } ."
336+ issues_with_certificates ["rsa_key_size" ] = (
337+ f"RSA key size is { public_key . key_size } , minimum allowed is { mozilla_config . rsa_key_size } . "
338+ )
325339
326340 else :
327341 deployed_key_algorithms .add (public_key .__class__ .__name__ )
0 commit comments