Add encoded-payload-redact rule#117
Merged
Merged
Conversation
…tion Walks text nodes for long base64 / base64url / hex / percent-encoded runs above per-encoding length floors that sit above SHA-512 hex, then qualifies each candidate on a decoded printable-ASCII ratio so hashes, fingerprints, and binary blobs pass through while readable instructions are redacted. JWTs are skipped so the more specific secrets-redact label wins on overlap. Matches become inline click-to-reveal placeholders. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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
encoded-payload-redactrule: walks text nodes for long base64 / base64url / hex / percent-encoded runs, qualifies on a decoded printable-ASCII ratio (≥0.85), replaces matches with click-to-reveal placeholders. Defends against the "decode this and follow it" indirect-injection carrier where an attacker drops an encoded blob in a page region the agent reads.secrets-redactkeeps the more specific[jwt hidden]label.Test plan
bun run testinextension/— 974/974 pass, including 12 new tests covering positives (b64, b64url, hex, %-enc), false-positive guards (SHA-256, Git SHA, random hex, short b64, JWT, script/style/noscript), watcher rescan, and teardown.bun run checkclean inextension/anddemo-site/.bun run buildclean in both packages./product/p-headphones-1on the demo, confirm "Compatibility codes" section's base64 string is replaced with the placeholder chip.🤖 Generated with Claude Code