Repository navigation
Conversation
Signed-off-by: jpantonow <jpantonow@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Affects
OkHttpClientModuleKt.setupSslinapp/src/main/java/me/ash/reader/infrastructure/di/OkHttpClientModule.kt.I found that
cachingHttpClientdefaultedtrustAllCertstotrue, causing the default client path to install an app-defined trust manager and an always-accepting hostname verifier. Default connections should validate certificates and hostnames rather than accepting every chain.I changed the default to
false, restoring platform validation for callers that do not explicitly request trust-all behavior. The existingtrustAllCerts=truepath and client-certificate setup remain unchanged.Servers whose certificate the system does not trust (self-signed or from a private CA), accepted silently until now, are rejected. The added network security config lets their users install that CA on the device; without it Android ignores user-installed CAs for apps targeting API 24 or later.
I found this while running the app under RVSec, a runtime-verification tool that watches the app's calls to the Java cryptography and TLS APIs and checks each sequence of calls against usage rules written in CrySL.
SSLContextSpecis the rule this code did not satisfy.How was this tested?
:app:assembleFdroidDebug)I'm an undergraduate Computer Engineering student at the University of Brasília (UnB); this contribution is part of a research project on the analysis of Android apps, and I'm happy to adjust it to match the project's conventions.