Skip to content

Commit a880fec

Browse files
Apply suggestions from code review
Co-authored-by: mc <[email protected]>
1 parent 12dc11a commit a880fec

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<p>
77
Certificate pinning is the practice of only trusting a specific set of SSL certificates, rather than those that the device trusts by default.
88
In Android applications, it is reccomended to use certificate pinning when communicating over the network,
9-
in order to minimize the risk of machine-in-the-middle attacks from a comprimised CA.
9+
in order to minimize the risk of machine-in-the-middle attacks from a compromised CA.
1010
</p>
1111
</overview>
1212

@@ -16,10 +16,10 @@ The easiest way to implement certificate pinning is to declare your pins in a <c
1616
This will automatically provide certificate pinning for any network connection made by the app.
1717
</p>
1818
<p>
19-
Another way to implement certificate pinning is to use the `CertificatePinner` from the `okhttp` library.
19+
Another way to implement certificate pinning is to use the `CertificatePinner` class from the `okhttp` library.
2020
</p>
2121
<p>
22-
A final way to implement certificate pinning is to use a <code>TrustManager</code>, initialized from a <code>KeyStore</code> loaded with only the neccesary certificates.
22+
A final way to implement certificate pinning is to use a <code>TrustManager</code>, initialized from a <code>KeyStore</code> loaded with only the necessary certificates.
2323
</p>
2424

2525
</recommendation>
@@ -36,13 +36,13 @@ The other (good) cases demonstrate the different ways to implement certificate p
3636

3737
<references>
3838
<li>
39-
OWASP Mobile Security: <a href="https://mobile-security.gitbook.io/mobile-security-testing-guide/android-testing-guide/0x05g-testing-network-communication#testing-custom-certificate-stores-and-certificate-pinning-mstg-network-4">Testing Custom Certificate Stores and Certificate Pinning (MSTG-NETWORK-4)</a>
39+
OWASP Mobile Security: <a href="https://mobile-security.gitbook.io/mobile-security-testing-guide/android-testing-guide/0x05g-testing-network-communication#testing-custom-certificate-stores-and-certificate-pinning-mstg-network-4">Testing Custom Certificate Stores and Certificate Pinning (MSTG-NETWORK-4)</a>.
4040
</li>
4141
<li>
42-
Android Developers: <a href="https://developer.android.com/training/articles/security-config">Network security configuration</a>
42+
Android Developers: <a href="https://developer.android.com/training/articles/security-config">Network security configuration</a>.
4343
</li>
4444
<li>
45-
OkHttp: <a href="https://square.github.io/okhttp/4.x/okhttp/okhttp3/-certificate-pinner/">CertificatePinner</a>
45+
OkHttp: <a href="https://square.github.io/okhttp/4.x/okhttp/okhttp3/-certificate-pinner/">CertificatePinner</a>.
4646
</li>
4747
</references>
4848
</qhelp>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
2-
* @name Android Missing Certificate Pinning
3-
* @description Network communication should use certificate pinning.
2+
* @name Android missing certificate pinning
3+
* @description Network connections that do not use certificate pinning may allow attackers to eavesdrop communications.
44
* @kind problem
55
* @problem.severity warning
66
* @security-severity 7.5

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212

13-
// GOOD: Certificate pinning implemented vis a TrustManager
13+
// GOOD: Certificate pinning implemented via a TrustManager
1414
KeyStore keyStore = KeyStore.getInstance("BKS");
1515
keyStore.load(resources.openRawResource(R.raw.cert), null);
1616

0 commit comments

Comments
 (0)