-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port mastg test 0020 (by @guardsquare) #3027
Conversation
|
||
## Overview | ||
|
||
You can observe the TLS protocol the app uses by observing the traffic on the network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to elaborate a bit on why "the TLS protocol the app uses by observing the traffic on the network" is a valuable (e.g. because of some limitation of doing it statically?)
@@ -0,0 +1,24 @@ | |||
--- | |||
title: Usage of Insecure TLS Protocols |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something more specific like "Usage of Insecure TLS Protocols in Network Traffic" or simply "Insecure TLS Protocols in Network Traffic"?
@@ -0,0 +1,34 @@ | |||
--- | |||
title: Usage of Insecure TLS Protocols |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something more specific like
- "Use of Insecure TLS Protocols in Code"
- "Insecure TLS Protocols Set in Code"
- or "Insecure TLS Protocols Explicitly Allowed in Code"?
The "in Code" differentiates this test from the other one which is done at the network level.
|
||
## Evaluation | ||
|
||
The evaluation fails if any ["insecure TLS version"](https://mas.owasp.org/MASTG/0x04f-Testing-Network-Communication/#recommended-tls-settings) is used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always start the evaluation with "The test case fails"
The evaluation fails if any ["insecure TLS version"](https://mas.owasp.org/MASTG/0x04f-Testing-Network-Communication/#recommended-tls-settings) is used. | |
The test case fails if any ["insecure TLS version"](https://mas.owasp.org/MASTG/0x04f-Testing-Network-Communication/#recommended-tls-settings) is used. |
|
||
## Overview | ||
|
||
Multiple ways to enable insecure protocols exist in Android: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe better like this since these are not the only 2 ways of doing this on Android, right?
Multiple ways to enable insecure protocols exist in Android: | |
There are several ways to enable insecure versions of TLS in Android, including: |
|
||
### Java Sockets | ||
|
||
If the app uses Java Sockets, the API call `javax.net.ssl.SSLSocket.setEnabledProtocols(String[] protocols)` sets the enabled protocols. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better something like (please improve):
Java Sockets effectively bypasses the Android Network Security Configuration. Using the API call javax.net.ssl.SSLSocket.setEnabledProtocols(String[] protocols)
allows the app to set insecure protocols.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left out the part of NSC here, since this is in the overview now and you cannot set the TLS version with it anyway.
|
||
## Evaluation | ||
|
||
The evaluation fails if any ["insecure TLS version"](https://mas.owasp.org/MASTG/0x04f-Testing-Network-Communication/#recommended-tls-settings) is directly enabled, or if the app enabled `okhttp3.ConnectionSpec.COMPATIBLE_TLS`.s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always start the evaluation with "The test case fails"
Please review the second edit. Maybe it's better to generalize this.
The evaluation fails if any ["insecure TLS version"](https://mas.owasp.org/MASTG/0x04f-Testing-Network-Communication/#recommended-tls-settings) is directly enabled, or if the app enabled `okhttp3.ConnectionSpec.COMPATIBLE_TLS`.s | |
The test case fails if any ["insecure TLS version"](https://mas.owasp.org/MASTG/0x04f-Testing-Network-Communication/#recommended-tls-settings) is directly enabled, or if the app enabled any settings allowing the use of outdated TLS versions, such as `okhttp3.ConnectionSpec.COMPATIBLE_TLS`. |
|
||
If the app uses Java Sockets, the API call `javax.net.ssl.SSLSocket.setEnabledProtocols(String[] protocols)` sets the enabled protocols. | ||
|
||
### OkHttp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include this and use okhttp as an example?
### Third-party Libraries
Other libraries, such as [OkHttp](https://square.github.io/okhttp/), [Retrofit](https://square.github.io/retrofit/) or Apache HttpClient may have their own configurations for TLS protocols.
For example, if the app uses OkHttp and sets the allowed TLS protocols to `ConnectionSpec.COMPATIBLE_TLS` by calling `okhttp3.ConnectionSpec.Builder.connectionSpecs(...)`, this results in one or more insecure TLS versions (e.g, in TLS v1.1 (see ["configuration history"](https://square.github.io/okhttp/security/tls_configuration_history/#okhttp-313))).
The API call `okhttp3.ConnectionSpec.Builder.tlsVersions(...)` (["OkHttp documentation"](https://square.github.io/okhttp/features/https/)) can also be used to set the enabled protocols.
Thank you for submitting a Pull Request to the OWASP MASTG. Please make sure that:
If your PR is related to an issue. Please end your PR test with the following line:
This PR closes #2961 .