Repository navigation
fix(privacy): redact AWS path keys and URL-safe Basic credentials - #1106
Merged
pengfei-threemoonslab merged 2 commits intoNov 6, 2026
Merged
pengfei-threemoonslab merged 2 commits into
pengfei-threemoonslab merged 2 commits into
Conversation
…ed Basic credentials An unlabeled AWS secret access key inside a path or URL segment (path/<key>, s3://bucket/<key>/obj, https://h/<key>?a=1) was skipped because the lookbehind (?<![A-Za-z0-9/+]) and lookahead (?![A-Za-z0-9/+=]) disallowed adjacent '/' characters. The pattern now permits '/' separators before and after the 40-character AWS base64 alphabet shape, relying on the existing _is_random_token check to preserve word-like paths (such as Sources/PaymentKit/Handlers/RefundTools2). Unlabeled Basic authentication tokens formatted with URL-safe base64 (RFC 4648 §5) or without standard '=' padding were skipped because BASIC_AUTH_RE only matched [A-Za-z0-9+/] and _is_basic_credential passed unpadded strings directly to b64decode(validate=True). The regex now admits URL-safe characters '-' and '_', and _is_basic_credential normalizes and re-pads unpadded tokens prior to decoding and validating the 'user:password' UTF-8 structure. Closes ThreeMoonsLab#1082
pengfei-threemoonslab
approved these changes
Nov 6, 2026
pengfei-threemoonslab
left a comment
Contributor
There was a problem hiding this comment.
Thanks for picking up #1082. I'm approving this.
3 tasks
10 of 15 tasks
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
Fix credential redaction gaps involving AWS secret access keys embedded in filesystem paths and URLs, and Basic authentication credentials encoded using URL-safe or unpadded Base64.
Changes
Validation
Scope
Two files changed:
src/agents_shipgate/core/privacy.pytests/test_privacy.pyCloses #1082