Skip to content

Commit 722bd4d

Browse files
Java: Revise qhelp
1 parent 4cfdb10 commit 722bd4d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

java/ql/src/Security/CWE/CWE-297/UnsafeHostnameVerification.qhelp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ An attack might look like this:
1515
<ol>
1616
<li>The program connects to <code>https://example.com</code>.</li>
1717
<li>The attacker intercepts this connection and presents an apparently-valid certificate of their choosing.</li>
18-
<li>The `TrustManager` of the program verifies that the certificate has been issued by a trusted certificate authority.</li>
19-
<li>Java checks whether the certificate has been issued for the host <code>example.com</code>. This check fails because the certificate has been issued for a ___domain controlled by the attacker, for example: <code>malicious.___domain</code>.</li>
20-
<li>Java wants to reject the certificate because the hostname does not match. Before doing this it checks whether a <code>HostnameVerifier</code> exists.</li>
18+
<li>The <code>TrustManager</code> of the program verifies that the certificate has been issued by a trusted certificate authority.</li>
19+
<li>The Java HTTPS library checks whether the certificate has been issued for the host <code>example.com</code>. This check fails because the certificate has been issued for a ___domain controlled by the attacker, for example: <code>malicious.___domain</code>.</li>
20+
<li>The HTTPS library wants to reject the certificate because the hostname does not match. Before doing this it checks whether a <code>HostnameVerifier</code> exists.</li>
2121
<li>Your <code>HostnameVerifier</code> is called which returns <code>true</code> for any certificate so also for this one.</li>
22-
<li>Java proceeds with the connection since your <code>HostnameVerifier</code> accepted it.</li>
22+
<li>The program proceeds with the connection since your <code>HostnameVerifier</code> accepted it.</li>
2323
<li>The attacker can now read the data your program sends to <code>https://example.com</code>
2424
and/or alter its replies while the program thinks the connection is secure.</li>
2525
</ol>

0 commit comments

Comments
 (0)