Repository navigation
fix(scrub): redact a secret after an escaped newline or a terminal code - #12
Merged
Merged
Conversation
Every secret and PII shape that opened with \b needed a non-word character before the secret. In JSON-escaped text (line one\nghp_...) and in coloured terminal output (ESC[32m..., \u001b[32m...) the character before the secret is a letter or a hex digit, so \b did not hold and the scan report kept the secret, or masked it only through the generic fallback without its own label. Each shape now starts at LEAD: \b, or right after an escaped \n \r \t \f \b, a \uXXXX escape, an ANSI CSI sequence (any final byte, raw or escaped as \u001b[, \x1b[ or \033[), or a character-set switch. The lookbehinds are bounded, a secret glued to a word is still not matched, and placeholders stay at the secret's own offset. The scrub corpus gains a GitHub token, an AWS key and a JWT in sixteen such positions, checked by scrubText and by the scan report's redaction. Regenerates both plugin bundles. Co-Authored-By: Claude <noreply@anthropic.com>
samc621
approved these changes
Oct 13, 2026
samc621
left a comment
Contributor
There was a problem hiding this comment.
@kashyap-techsuite nice solution, LGTM!
Contributor
|
🎉 This PR is included in version 0.4.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Secret shapes now also match right after an escaped \n/\r/\t/\f/\b, a \uXXXX escape, an ANSI CSI code (raw or escaped) or a charset switch. Adds those cases to the scrub corpus.