fix(security): redact auth headers from OkHttp logging#4816
Open
IvanBila wants to merge 1 commit into
Open
Conversation
Register a single app-owned HttpLoggingInterceptor on the SDK's
D2Configuration.networkInterceptors with redactHeader("Authorization"),
"Cookie", "Set-Cookie" and "Proxy-Authorization". Level is NONE in
release and BASIC in debug, so even a developer flipping levels for
local debugging will not leak credentials via logcat.
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
logging-interceptor:4.12.0is on the runtime classpath (force-pinned inapp/build.gradle.kts), but no app-ownedHttpLoggingInterceptorexists withredactHeader(...)configured. A misconfigured dev build or a future SDK change that enables body-level logging would leakAuthorizationto logcat.Change
HttpLoggingInterceptoronD2Configuration.networkInterceptorsinServerModule.getD2Configuration(...).redactHeader("Authorization"),"Cookie","Set-Cookie","Proxy-Authorization".BASICin debug,NONEin release.Test plan
Authorization: ██when BODY is enabled locally.