fix(security): extend compression_failure_pairs redaction to JWT Bearer tokens#1860
Merged
fix(security): extend compression_failure_pairs redaction to JWT Bearer tokens#1860
Conversation
…er tokens Add BEARER_RE and JWT_RE patterns to redact_sensitive() in compression_guidelines.rs. BEARER_RE (case-insensitive) matches Authorization: Bearer headers and replaces the token value with [REDACTED] while preserving the header name. JWT_RE matches standalone Base64url JWTs including alg=none tokens with empty signatures. Closes #1847
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
BEARER_REstatic (case-insensitive) toredact_sensitive()— matchesAuthorization: Bearer <token>headers, replaces token value with[REDACTED], preserves header name via capture groupJWT_REstatic — matches standalone Base64url JWTs (eyJ...) includingalg=nonetokens with empty signatures, replaces with[REDACTED_JWT]alg=noneempty-signature JWT, mixed content (all 4 patterns), partial JWT not matched,Cow::Borrowedfast-path for partial-JWT inputTest plan
cargo +nightly fmt --check— cleancargo clippy -p zeph-memory --all-targets -- -D warnings— zero warnings in changed filecargo nextest run --workspace --features full --lib --bins— 5841 passedCloses #1847