fix(browse): case-insensitive exfiltration-domain blocklist matching (#2190)#2228
Open
time-attack wants to merge 1 commit into
Open
fix(browse): case-insensitive exfiltration-domain blocklist matching (#2190)#2228time-attack wants to merge 1 commit into
time-attack wants to merge 1 commit into
Conversation
urlBlocklistFilter compared URLs against the exfiltration blocklist with case-sensitive substring checks, so an uppercased sink (https://WEBHOOK.SITE/x) bypassed the guard and reached the scoped browser agent. Normalize the page URL and extracted content URLs to lowercase before comparing, and make URL extraction scheme-insensitive so HTTPS:// links are still caught. Fixes garrytan#2190 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
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.
What was broken (plain English)
The browser assistant keeps a blocklist of shady sites known for stealing data. The check only matched lowercase web addresses, so a booby-trapped page could point to the same bad site written with capital letters and slip right past the guard. The assistant would then hand that dangerous link back instead of blocking it.
How it was fixed (plain English)
The guard now ignores capitalization when it compares a web address to the blocklist. A known data-stealing site is caught whether it is written in lowercase or uppercase. Ordinary sites that happen to use capital letters are still allowed through, so nothing legitimate gets blocked by mistake.
Fixes #2190
Technical detail
urlBlocklistFilterinbrowse/src/content-security.tscompared URLs againstBLOCKLIST_DOMAINSwith case-sensitive substring checks (url.includes(domain)/contentUrl.includes(domain)). Because hostnames and URL schemes are case-insensitive (RFC 3986), an uppercased exfiltration sink such ashttps://WEBHOOK.SITE/xbypassed the filter and reached the scoped browser agent.The fix:
iflag to the content URL-extraction regex so an uppercased scheme (HTTPS://) can't evade extraction either.Live before/after evidence
Each probe drives the exact server-egress security decision (
runContentFiltersin block mode — the same callbrowse/src/server.tsmakes for a scoped browser agent) against isolated baseline (pinned toorigin/main) and candidate installs, with a page linking to an uppercased exfil sink. Baseline and candidate commands are byte-identical.Baseline verdict:
blocked=false … ALLOWED — uppercase exfiltration sink bypassed the blocklist.Candidate verdict:
blocked=true … warnings=["Content contains blocklisted URL: https://WEBHOOK.SITE/…"] … BLOCKED.Controls confirm the fix does not over-block legitimate uppercase domains (e.g.
GitHub.com).Tests
Added 4 regression tests in
browse/test/content-security.test.ts(case-insensitive page URL, case-insensitive content URL, uppercased scheme, and no over-block on legitimate uppercase domains). Full file: 62 pass / 0 fail.