mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Java: Apply suggestions for QHelp
This commit is contained in:
@@ -6,14 +6,20 @@
|
|||||||
<p>
|
<p>
|
||||||
If the <code>checkServerTrusted</code> method of a <code>TrustManager</code> never throws a <code>CertificateException</code> it trusts every certificate.
|
If the <code>checkServerTrusted</code> method of a <code>TrustManager</code> never throws a <code>CertificateException</code> it trusts every certificate.
|
||||||
This allows an attacker to perform a machine-in-the-middle attack against the application therefore breaking any security Transport Layer Security (TLS) gives.
|
This allows an attacker to perform a machine-in-the-middle attack against the application therefore breaking any security Transport Layer Security (TLS) gives.
|
||||||
|
</p>
|
||||||
|
|
||||||
An attack would look like this:
|
<p>
|
||||||
1. The program connects to <code>https://example.com</code>.
|
An attack might look like this:
|
||||||
2. The attacker intercepts this connection and presents a valid, self-signed certificate for <code>https://example.com</code>.
|
</p>
|
||||||
3. Java calls the <code>checkServerTrusted</code> method to check whether it should trust the certificate.
|
|
||||||
4. The <code>checkServerTrusted</code> method of your <code>TrustManager</code> does not throw a <code>CertificateException</code>.
|
<ol>
|
||||||
5. Java proceeds with the connection since your <code>TrustManager</code> implicitly trusted it by not throwing an exception.
|
<li>The vulnerable program connects to <code>https://example.com</code>.
|
||||||
6. The attacker can now read the data your program sends to <code>https://example.com</code> and/or alter its replies while the program thinks the connection is secure.
|
<li>The attacker intercepts this connection and presents a valid, self-signed certificate for <code>https://example.com</code>.
|
||||||
|
<li>The vulnerable program calls the <code>checkServerTrusted</code> method to check whether it should trust the certificate.
|
||||||
|
<li>The <code>checkServerTrusted</code> method of your <code>TrustManager</code> does not throw a <code>CertificateException</code>.
|
||||||
|
<li>The vulnerable program accepts the certificate and proceeds with the connection since your <code>TrustManager</code> implicitly trusted it by not throwing an exception.
|
||||||
|
<li>The attacker can now read the data your program sends to <code>https://example.com</code> and/or alter its replies while the program thinks the connection is secure.
|
||||||
|
</ol>
|
||||||
</p>
|
</p>
|
||||||
</overview>
|
</overview>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user