Repository navigation
fix(security): keep links whose path is encoded words - #22571
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Sensitive Change ReviewSensitive files changed:
How to clear this check:
Only the author's comment counts this way. A reviewer can instead |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. The waiver covers only encoded words in the path, which already pass when written unencoded. The query and OAuth gates stay strict. [DESIGN-REVIEWED] 2082c0e Description read[DESCRIPTION-READ] f544ca3f68c6c604e2e8eb39fe57dc82470219dd39c5d8f2c99ae6a8d4056161 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 Nothing blocks. This is a scoped fix for #22498, and the new tests fail on base. The rewritten CJK test was checking the blocked link's record, not deciding that CJK paths must be blocked. What this change shipsInventory (6 items) — 5 justifiedIntent: a link whose path is non-ASCII words (Chinese, Japanese, Russian) shows as a link in chat, not as a blocked-link card. FIX.
[FIRST-PRINCIPLES-REVIEWED] 2082c0e Description read[DESCRIPTION-READ] b6c9dd33e3ffbe1ad70b8c355806e579dc9f646d42d661bda70492e460eb9f4a That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
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: |
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: This diff relaxes a rule rather than tightening one. TIGHTENING: None. The only mechanism touched is the heavy percent-encoding detector inside ADJUDICATED: 11 candidates, 0 confirmed newly-refused PLATFORM COVERAGE: The diff itself makes no path, separator, executable or environment-variable assumption. Its only spelling-sensitive input is a URL percent run.
No assumed platform went unprobed. UNADJUDICATED:
[SCOPE-REVIEWED] 2082c0e |
d934b54 to
ac1d8ca
Compare
ac1d8ca to
e4022d5
Compare
|
[operator: bolichen97] Disposition: rebutted
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Review lanes on the head carry CONCERNS (advisory) and no BLOCK; the watch holder read them and approved explicitly.
e4022d5 to
3961dbf
Compare
3961dbf to
2082c0e
Compare
Problem / Motivation
Goal: A link whose path is words in Chinese, Japanese, Russian or another non-ASCII script shows as a link in chat instead of a blocked-link card.
A news link like
https://hk.finance.yahoo.com/news/<Chinese headline>.htmlis shown as[REDACTED: suspicious URL to hk.finance.yahoo.com]with ruleexfil_percent_encoding(#22498). The browser writes each Chinese character as three percent-encoded bytes, so seven characters already make the 20+ byte run the heavy percent-encoding rule flags.Why it matters
Anyone who reads or shares links in a non-Latin script hits this on ordinary news, wiki and shop links. The card hides the link they asked for, and it teaches people that the redactor is noise.
Not a goal
?q=...stay flagged, as today.website/src/utils/sanitize.ts). It never percent-scans the path, so nothing there changes.What changed (motivation → approach → change)
A path run of percent bytes is skipped by the heavy percent-encoding rule only when it is words: every byte non-ASCII, strict UTF-8, and every character a letter, mark, number or punctuation whose NFKC form is not an ASCII letter or digit.
%41%41...), even one byte inside wordsAKIA..., invisible, private-use, space, bad UTF-8This opens no new channel. The path gets no base64 or length check today, so the same words, or any ASCII text, written unencoded already pass. The rule lives in
security/exfil_url_rules.py(_heavy_percent_encoding);security/exfil.pycalls it. The security spec gains one bullet. The security package line budget rises by the 37 new lines.Backwards compatibility
Compatible: the change only stops flagging one shape that was flagged before; nothing that renders today stops rendering.
Removes nothing: the change narrows when a link is hidden; no record, field, key or function is removed.
Tests
test/test_exfil_path_text.py(new): the reported Yahoo link and Japanese, Russian and punctuated Chinese paths are kept; encoded ASCII, ASCII inside a word run, fullwidth letters, invisible, private-use, ideographic space and non-UTF-8 runs in the path are still redacted; Chinese words in the query are still redacted; the OAuth admission gate still rejects a Chinese path. Red onmain(the kept cases fail), green here; the OAuth case is red if the gate is given the waiver.test/test_redaction_blocked_links.py::test_a_cjk_title_link_keeps_its_whole_address: it relied on a Chinese PATH being blocked. The title moves into the query, which is still blocked, so it keeps testing that a blocked link keeps its whole address.test/test_security_gate_liveness.py: budget raised from 32,060 to 32,097 (this PR's 37 lines on top of main) with its reason.Manual verification
N/A — unit coverage sufficient: the rule is a pure function of the URL text, and the tests drive the real
redact_exfiltration_urlsandoauth_url_contains_credentialentry points with the reported URL.Related Issues
Closes #22498
#21573 (merged) also raised the same line budget; this PR is rebased on it and adds its 37 lines on top.
Pattern harvest
Rule candidate: review-prompt
Pattern: a byte-run heuristic on percent-encoded text must say whether the bytes decode to words before calling them a payload.
Sensitive change review
Draft for a maintainer other than the author to verify and paste into an approval on the current head.
_exfil_url_warningheavy percent-encoding rule skips a PATH run that decodes to non-ASCII words.exfil_percent_encoding; now it renders. Encoded ASCII, fullwidth letters, invisible or private-use characters, invalid UTF-8, any run in the query, and the OAuth admission gate are blocked as before.test/test_exfil_path_text.pyred on main and green here; the OAuth case turns red when the gate gets the waiver.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)