Repository navigation
fix(redaction): mask a bare Bearer token, short named values and the token name - #39264
chenmingwei23 wants to merge 2 commits into
Conversation
Sensitive Change ReviewSensitive files changed:
How to clear this check:
Only the author's comment counts this way. A reviewer can instead |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: these are new rows in the existing structured redactor, they only mask more, and a revert undoes them. Notes
[DESIGN-REVIEWED] 3c17321 Description read[DESCRIPTION-READ] 7712b499182f5c91c3d000f86e7aaaeffa136283b1e5302ad7f6c5f520874656 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Every item closes a credential shape that used to leak, or follows directly from a fix that does. The one undeclared rider, the MCP reorder, is needed by the bare Bearer reader. Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: keep bearer tokens, short labelled secrets and
[FIRST-PRINCIPLES-REVIEWED] 3c17321 Description read[DESCRIPTION-READ] 275a310f33371c1ac1fa9a94745e9f628e3b4a852fd59c00ff3e5e638b4e0b45 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
959f505 to
ef8623b
Compare
Opus 5.5 Review — 🔴 changes requested (blocking)Reviewed Blocking: this change moves the exact-match scrub of configured header values ahead of the generic credential scanners. A short, harmless header value such as BLOCKING — src/kiro_crew/mcp_discovery_server_info.py:248 Trigger: an MCP server is configured with [BLOCK-MERGE] 3c17321 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Security Scope Review -- ✅ PASSWhich legitimate operations does Verdict basis: adjudicated, zero confirmed regressions. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: PASS Reason: The tightening is in the output credential redactor ( TIGHTENING: The credential rule table masks more values. It adds a bare-Bearer reader, ADJUDICATED: 17 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: The diff assumes nothing about paths, separators or interpreters in a shell command line. Its only boundaries are text shapes:
The new reader stops a value at UNADJUDICATED:
[SCOPE-REVIEWED] 3c17321 |
bfb27cf to
de50ae8
Compare
Sensitive change review
|
de50ae8 to
02c9579
Compare
…n=, update tests that pinned them as visible Adds tests for a bare 'Bearer <token>' (words after Bearer stay), a 6 to 7 character value after a listed name, the token name with benign pins, and a long token cut by an ellipsis (still masked) versus a short elided example (kept). Updates existing tests that pinned the old output as visible: a Basic credential stands in where a test needs a value masked only beside its key, token= spellings now pin the masked value, a 7 character fixture value becomes 5 characters, and TOKEN moves to the list of names that are read.
…token name A 'Bearer <token>' with no Authorization name before it is masked whole, including a percent-escaped part of the token; words after Bearer stay, including a capitalised or upper case word. A written value of 6 or more characters after a listed credential name is masked (was 8). The bare name token is listed. A value ending in an ellipsis stays only when what precedes the ellipsis is shorter than 8 characters, so a long token cut by an ellipsis is still masked. The probe-error scrubber now masks the configured header values first and then runs the generic scanners, so a generic match can no longer mask only part of a configured value before the exact scrubber looks for it. The security spec and the MCP architecture note describe the bare Bearer token and that order.
02c9579 to
3c17321
Compare
Problem / Motivation
Goal: The redactor masks a bare
Bearer <token>, shorter values after a listed credential name, and the bare nametoken, which it used to leave visible.Today a
Bearer <token>with noAuthorizationname before it, a 6 or 7 character value after a listed name, and a value after the bare nametokenall pass through unmasked. A long token cut by a trailing ellipsis would also pass if the ellipsis exemption were applied to every length.Why it matters
Frozen. Credentials in logs and tool output that look like these shapes stay readable to anyone who reads the output.
Not a goal
-upasswords (1 to 3 characters) stay visible.What changed (motivation → approach → change)
Each shape was a gap in the structured redactor's header and known-key readers.
Bearer <token>reader masks the token; words after Bearer ("Bearer of bad news") stay.tokenjoins the listed credential names, with the same checks aspassword(placeholders, code and plain words stay;tokenizer=fastandtoken=words like thisstay)....or an ellipsis character stays visible only when what precedes the ellipsis is shorter than 8 characters. A long token cut by an ellipsis is still masked.Merge order: after #38807.
Backwards compatibility
Compatible: the change only masks more values; nothing that is accepted today is rejected, renamed or removed.
Removes nothing: no field, key or function is removed; more text is masked.
Tests
Two commits: the tests (new tests that fail on main, plus updates to existing tests that pinned a bare Bearer value, a bare
tokenname or atoken=spelling as visible; a Basic credential stands in where a test needs a value masked only beside its key;TOKENmoves to the "names read" list), then the change.password,secretandtokenis masked;password=x1stays.sk-...stays forpasswordandtoken; a long synthetic token cut by...or the ellipsis character is masked.tokenizer=fastandtoken=words like thisstay.Proof: not provable -- other: prove.py cannot run on the worker machine (no test runner installed); CI runs the tests.
Manual verification
N/A -- unit coverage sufficient; the readers are pure functions of the input text.
Real-machine verification
Not run on a separate machine; the change is text-only redaction logic covered by the tests above.
Related Issues
None.
Sibling sweep
Swept: git grep -nE "LITERAL_MIN|_NAMELESS_READERS" -- src/
Siblings: none -- the floor and the reader set are each defined once in the structured redactor.
Pattern harvest
Not generalizable: each shape was a missing case in a table-driven reader, not a repeated code pattern.
Checklist
Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.