Skip to content

Commit f527df7

Browse files
intrigus-lgtmfelicitymay
authored andcommitted
Apply suggestions from code review.
Co-authored-by: Felicity Chapman <[email protected]>
1 parent f0d4b1d commit f527df7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.qhelp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,15 @@ See below for an example of how to do this.
3333

3434
<example>
3535
<p>
36-
In the first (bad) example, the <code>TrustManager</code> never throws a <code>CertificateException</code> thereby trusting any certificate.
36+
In the first (bad) example, the <code>TrustManager</code> never throws a <code>CertificateException</code> and therefore implicitly trusts any certificate.
3737
This allows an attacker to perform a machine-in-the-middle attack.
38-
In the second (good) example, no custom <code>TrustManager</code> is used. Instead, the self-signed certificate that should be trusted
39-
is explicitly trusted by loading it into a <code>KeyStore</code>.
38+
In the second (good) example, the self-signed certificate that should be trusted
39+
is loaded into a <code>KeyStore</code>. This explicitly defines the certificate as trusted and there is no need to create a custom <code>TrustManager</code>.
4040
</p>
4141
<sample src="InsecureTrustManager.java" />
4242
</example>
4343

4444
<references>
45-
<li><a href="https://developer.android.com/training/articles/security-ssl">Android Security Guide for TLS/HTTPS</a>.</li>
46-
<li>OWASP: <a href="https://cwe.mitre.org/data/definitions/295.html">CWE-295</a>.</li>
45+
<li>Android Develoers:<a href="https://developer.android.com/training/articles/security-ssl">Security with HTTPS and SSL</a>.</li>
4746
</references>
4847
</qhelp>

java/ql/src/Security/CWE/CWE-295/InsecureTrustManager.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import DataFlow::PathGraph
2020
/**
2121
* An insecure `X509TrustManager`.
2222
* An `X509TrustManager` is considered insecure if it never throws a `CertificateException`
23-
* thereby accepting any certificate as valid.
23+
* and therefore implicitly trusts any certificate as valid.
2424
*/
2525
class InsecureX509TrustManager extends RefType {
2626
InsecureX509TrustManager() {

0 commit comments

Comments
 (0)