Repository navigation
feat(security): name the rule that redacted a URL after its placeholder - #14783
Pearcekieser wants to merge 1 commit into
Conversation
|
Intent: A blocked link's placeholder names the kind of rule that removed it, using fixed words keyed by rule id, so a reader can tell a likely secret from a heuristic false positive. |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the reason is looked up from a fixed table keyed by rule id, the tag keeps main's shape, and every in-tree reader matches the tag by prefix or by substring. Notes
[DESIGN-REVIEWED] 564bf30 Description read[DESCRIPTION-READ] 0756f8791436bb05a578dca03d4ec9ad169264b0fa2997fdd988337e9e7028d1 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 |
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. Both attachments show all five reasons and the chip followed by its reason, in dark and light themes. This fork lane has no blind read, so nobody new to the product has read these strings yet; pushing the branch to this repo gets one. Notes
[UX-REVIEWED] 564bf30 Description read[DESCRIPTION-READ] 832819f60a3e4fb6ff5f89c3aa67b474e88c3af4435fac460803b8e10c3f10dc That sha256 names everything this verdict read: the PR description, plus the 5 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 |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix targets the cause (the placeholder named only the host) and is tied to #14782. Two notes concern the reason wording now living in two tables. Notes
What this change shipsInventory (8 items) — 6 justifiedIntent: let a reader of a blocked-link placeholder on any surface tell a likely secret from a heuristic false positive. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 564bf30 Description read[DESCRIPTION-READ] bf86df93ced2c18c6c27a8f742a40ec3612493880c1262014dd0f8b8d6b1eecd That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
d9be12f to
f11b2c2
Compare
|
suggestion (non-blocking): "heavy encoding" sorts to the wrong side of the secret/false-positive line
|
|
question (non-blocking): no cold reader has read the five reasons
|
|
suggestion (non-blocking): replace "data-like query"
|
|
fixed in f11b2c2: the security package line budget in |
Security Scope Review (fork) — ✅ PASSWhich legitimate operations does adjudicated, zero confirmed regressions Scope-Verdict: PASS Reason: The diff changes the text written after a blocked link and how two readers handle that text. It doesn't touch any of the three shell deny tiers: TIGHTENING: segment-save leak check ( ADJUDICATED: 14 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: posix and windows. The diff adds no assumptions about paths, separators, interpreters or environment variables in the deny path. Its only new assumption is a fixed ASCII suffix UNADJUDICATED: Guard: the chat segment-save consistency check in
The suffix match is exact and whole ( [SCOPE-REVIEWED] 564bf30Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. |
f11b2c2 to
5d9fee1
Compare
|
suggestion (blocking): the reason words name the detector, not the verdict
|
|
issue (blocking): no image of the reasoned placeholder rendered where a record is absent fixed: the description now carries screenshots (dark, light) of all five reasons rendered by |
|
note (non-blocking): no blind reader has read the new strings
|
5d9fee1 to
4264b8b
Compare
|
suggestion (non-blocking): restore the Detects bullet
|
|
issue (non-blocking): the Detects bullet rides along
|
|
issue (non-blocking):
|
|
issue (non-blocking): the spec's Detects sentence was corrupted by the find-replace
|
|
suggestion (non-blocking): the label words are now part of the persisted message format
|
|
issue (non-blocking): stray replacement in the spec's scan bullet
|
|
issue (non-blocking): raw-copy adoption in
|
|
suggestion (non-blocking): build
|
|
Rebased onto main (e86fbdc) with no behaviour change, to pick up #29942. That PR removed the three strict scale-F4 markers that failed Backend Tests (3.12, 4) on f04ce29. The rebase had no conflicts and |
|
Rebased onto main (068a1f5) with no behaviour change. The only conflict was |
bolichen97
left a comment
There was a problem hiding this comment.
Requesting changes at b9561ae for one reason: naming the rule in the placeholder is done by widening regexes that parse redacted text, and our review rule does not accept a solution that adds or widens regex parsing.
The widened patterns are:
- the placeholder pattern in
messaging/display_safety.pygains an optional(<reason>)group built from_REDACTION_TAG_REASONS _PLACEHOLDER_REinsecurity/exfil.pynow also accepts a bracketed host and the same optional reason suffix, via the newEXFIL_RULE_REASONS_RE
Each new reason word is now one more alternation that every downstream reader has to match exactly. A placeholder that drifts from the pattern stops being recognised as a placeholder, which in this code path is a redaction miss.
A structured approach would avoid that, for example:
- carry the rule as a typed field next to the redacted span, the way the redaction cards already get their data, instead of encoding it into the placeholder text and parsing it back out, or
- if it must live in the text, split the known suffix with an exact token check (
endswith(" (" + reason + ")")against the fixed reason set) rather than extending the regex.
The security direction itself is neutral: it labels a redaction and refuses nothing new, so that part is fine. CI is still running on this head, and GPT, Opus and Sensitive Change Review are red. Please look at those lanes too when you push.
|
@bolichen97 Thanks. I will take your second option and remove every regex change in this PR. The reason moves outside the tag:
The second commit ( |
|
@bolichen97 Pushed the redesign as one commit, 67da36d.
The body and the screenshots describe the new form. Locally, 505 test files ran with 30,139 passed. The 79 failures are |
|
Re-reviewed at 67da36d: the regex change I asked for is done, thank you.
I searched the product hunks for the old names and for What still blocks a merge is outside your control. Sensitive Change Review cannot pass on a fork PR that changes a sensitive path; its log says a maintainer has to re-open it from a branch of this repository. I am flagging that to the maintainers. Lint, ratchets and the AI lanes are still running on this head. |
|
|
The review lanes did not publish on 98c5ecf. GPT 6.1 Review says "verdict not published": it reached a verdict for this head, but the lane's PR comment still shows 67da36d. Opus 5.5 Review says "review incomplete", and Security Scope Review says "no leg reported". None of these is a finding on the code. A fork cannot re-run a job, so if the lanes are still unpublished at about 03:15Z, I will push the same tree on a new commit date to run them again. |
|
Rebased onto main (03dc8a1) with no behaviour change. The rebase had no conflicts and |
|
Backend Tests (3.12, 1) failed on c3c2536 on one test out of 29,066: |
|
The GPT and Opus lanes on c3c2536 have finished, and neither published. GPT run 41971311948 failed at "Fetch authentic diff". Opus run 41971311862 failed at "Opus 5.5 discovery", and its log says the run produced no completed verdict and the comment lookup also failed. Both PR comments still name 67da36d. The lanes did not publish on 98c5ecf either, so a third push would likely not help. I am leaving the head as it is for the maintainer re-review. A re-run of these two runs would put this head's verdicts on the PR. |
|
Rebased onto main (28cb680) with no behaviour change. The only conflict was |
|
Backend Lint & Type Check (3.12) failed on 9d75e84 with two |
|
Rebased onto main (7785e9c) with no behaviour change, to pick up #30762, which fixed the |
|
Backend Tests (3.12, 3) failed on efdd59f on one test out of 31,264: |
|
Rebased onto main (0b4e7fe) with no behaviour change. Two conflicts, both pins:
Since the last head, the commit also re-pins two expectations in |
|
Security Scope Review on eebb868 shows BLOCK only because "the per-platform reports could not be folded"; its own verdict is PASS with no regression confirmed. A re-run of that lane would settle it. |
|
Lanes on 9dfba42 that need a re-run: GPT 6.1 Review reached a verdict but did not publish it, Opus 5.5 Review ended incomplete with no PR comment, and Security Scope Review failed closed because it could not read the prior conclusion (0 newly refused on macOS, Ubuntu and Windows). |
|
Static Ratchet Gate and Fast Gate on 6823dc6 are red from main. |
|
1f0ba60 has the same tree as 9a39879 (56ed0d15cf94) and no code change. It re-triggers two lanes. Await Fast Gate hit the CI-app rate limit at 03:58Z while it read the Fast Gate verdict, which itself passed, so every test job was skipped and Coverage Gate failed closed. The Security Scope Review generate job did not finish, so no leg ran. |
|
Backend Tests (3.12, 7) on 1f0ba60 (job 129639053080) needs a re-run. |
|
These lanes on 3f0547b need a re-run. GPT 6.1 Review run 42961430536 reached a verdict but did not publish it, because its GitHub API calls hit the installation rate limit at 04:52Z. Opus 5.5 Review run 42961430560 failed closed after its validation step got "API rate limit exceeded for installation" at 04:52:24Z. Security Scope Review run 42961430533 had no leg rows to combine, because the ubuntu-latest leg did not connect to github.com port 443 during checkout at 04:51:11Z. |
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 14% chance that this change introduces a defect, above the 12% limit for approving on its own. The placeholder keeps main's exact tag shape and gains a reason looked up from a fixed table by rule id, so no URL text reaches it. No blocking pattern, threshold, order or exemption changes. Every in-tree reader of the tag (restore_allowed_links, display_safety._REDACTION_TAG, segment_flush's placeholder regex and _links_main_shows, pass_compose, the renderer counters, the frontend BLOCKED_LINK_PLACEHOLDER_RE) matches by prefix, substring or main's pattern, so the suffix breaks none of them. Restoring an allowed link removes only that record's own reason, matched exactly; old rows without a reason are left as they are, and credential links are never restored. The segment-save check strips the fixed reasons from both copies, so a chunk boundary that trips a different rule doesn't withhold the reply, and a removed value that contains a tag is still counted. The new tests would fail without the change, and the existing tests I left unchanged only check substrings or the prefix. Approve, with notes on rendering polish and the pending CI. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
|
Coverage Gate on 958fe50 (run 43027461377) needs a re-run. It failed because |
|
Run 43089712565 needs a re-run of Backend Tests (3.12, 1) to (3.12, 5), Frontend Tests (2) and Coverage Gate. Shards 1 to 4 and Frontend Tests (2) passed their tests and then failed at artifact upload with |
|
Run 43295424524 needs a re-run. Its Await Fast Gate job failed on the installation API rate limit at 19:57Z, so every test job in that run was skipped and Coverage Gate failed closed. Dependency License Gate (run 43295424521) and Publish readiness signal (run 43295417057) failed on the same rate limit. |
A blocked link now reads [REDACTED: suspicious URL to <host>] (<reason>), with the reason looked up from a fixed table keyed by rule id, so a reader can tell a likely secret from a shape heuristic. The tag keeps its old shape, so no pattern that reads it changes. The two readers that need the reason compare the whole suffix against the fixed set: restore_allowed_links drops the restored record's own reason, and the chat segment save drops it before it compares the streamed copy with the whole-text copy.
Problem / Motivation
Goal: A blocked link's placeholder is followed by which kind of rule removed it, so a reader can tell a likely secret from a false positive.
A blocked link is replaced with
[REDACTED: suspicious URL to <host>]. The redactor blocks for two different reasons: the link held something shaped like a credential, or it only tripped a shape heuristic (a 200+ character query, a base64-like run). The placeholder does not say which, so the reader cannot choose between stripping the query and reporting a false positive.Why it matters
The dashboard's Blocked link chip explains the reason only when its record survives. Slack, iMessage and the other channels, the model's own context, and any message whose record was dropped see the placeholder text and nothing else. Every false positive there looks exactly like a leaked secret.
Not a goal
website/src/utils/sanitize.ts. It has no rule ids and redacts only on client-only render paths.What changed (motivation → approach → change)
A blocked link's placeholder is now followed by the reason it was blocked, so a reader can tell a likely secret from a heuristic false positive.
exfil_hard_credential,exfil_fixed_credentialcredentialexfil_encoded_credentialencoded credentialexfil_percent_encoding,exfil_decode_saturatedheavy encoding, may be legitimateexfil_query_lengthlong query, may be legitimateexfil_query_patternrandom-looking query, may be legitimateA blocked link now reads
[REDACTED: suspicious URL to learn.example.com] (long query, may be legitimate)._exfil_url_warningalready reported a stable rule id that it never builds from URL text.exfiltration_redaction_tag()looks that id up in the fixedEXFIL_RULE_LABELStable and writes the words after the tag. A rule missing from the table gets no reason, which is the old text.The tag itself keeps main's exact shape, so no pattern changes.
_PLACEHOLDER_REinexfil.py,_REDACTION_TAGinmessaging/display_safety.py,_LINK_PLACEHOLDER_REindashboard/chat_turn/segment_flush.pyandBLOCKED_LINK_PLACEHOLDER_REinRedactionCards.tsxare all main's. Two readers need the reason, and both compare the whole suffix against the fixedEXFIL_RULE_REASON_SUFFIXES:restore_allowed_linksputs an allowed link back in place of its tag. Withstartswith, it also removes the(<reason>)of the record it restores, and leaves any other text._without_reasonsreplaces each exact] (<reason>)with]in both copies, before the run-by-run check (_blank_tags, then main's pattern) and before the count of each value a delta removed (_kept_removed_values).The prefix constant, the table and the builder live in
security/exfil_url_rules.py, becauseexfil.pyis at the 2,000-line cap.exfilre-exports them, so every caller keeps its import. The categories are documented indocs/system-specs/modules/security.md, andstories/Redaction.stories.tsxrenders every reason.test/test_security_gate_liveness.pyre-pins the security package line budget for the 37 lines this adds, with the reason next to the number.Security argument: the reason is a lookup keyed by a rule id from a closed set, so it cannot carry attacker-chosen bytes; two URLs on one host that trip the same rule redact to identical text. No check, threshold, order, exemption or pattern changed, so nothing that was blocked passes. The restore path still restores only records whose rule is
exfil_query_lengthorexfil_query_pattern.Backwards compatibility
Compatible: the prefix constant, the tag shape and every rule are unchanged, and text saved before this change has no reason after its tags. Redacted text grows by up to 42 characters for each blocked link, so a length-capped field that is measured after masking, such as an autonudge banner near its 500-character cap, can now be refused where main accepted it. On the last-resort delivery path that removes every whitespace run outside tags (
messaging/split._flattened_for_any_cut), the reason loses its spaces and reads(longquery,maybelegitimate); the tag and its count are kept.Tests
test/test_exfil_rule_labels.py: one real URL per rule id produces its reason after the tag, the tag keeps main's shape and the suffix is one of the fixed set, the prefix stays intact, two different URLs tripping the same rule give identical text, an unknown rule adds no reason, everytrace()id inexfil.pyhas a table entry, and redaction stays a fixed point.[fd00::1]. A delta that removed the one letterhdoes not withhold a reply whose whole-text reason has morehthan the streamed one. The five shipped suffixes stay inEXFIL_RULE_REASON_SUFFIXES.MarkdownRenderer.blockedLink.test.tsx: a tag followed by a reason still pairs with its record and the reason shows after the chip, one with no record stays as text, and words inside the tag never pair.test_markdown_link_parentheses*.pytake the tag from the redactor's output with the exact suffix removed.test_slack_handler_composition_contract_golden.py: three digests change. With an empty reason table they match main, so the reason is the only change.test_autonudge_banner.py: the at-cap banner negative control uses a longer URL, because the reasoned text is longer than its old 65-character fixture; it still proves a banner that redaction shrinks is accepted.Manual verification
N/A. Unit coverage exercises the redactor end to end on real URLs and the renderer on real markdown.
Screenshots / video
Each reason as a reader sees it when the tag has no record (a channel message, or a dashboard reply whose record was dropped), plus one tag with its record rendering as the unchanged Blocked link chip with the reason after it. Captured from the
Chat/Redaction/PlaceholderReasonsstory.Light theme
Related Issues
The closing reference is the last line of this description.
Checklist
Fixes #14782