Inappropriate implementation in Chrome for iOS (CVE-2026-13916)
The iOS Chrome content blocker used unanchored regular expressions for its if-top-url trigger, so a URL containing the substring file:// anywhere would match. An attacker could append that substring to their own page URL and frame a victim site, causing the browser to block the victim's scripts and stylesheets and enabling clickjacking.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
Flapjack, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: The iOS Chrome content blocker uses unanchored regular expressions (e.g., file://.*) for its if-top-url trigger to block external subresources on privileged pages. An attacker can potentially exploit this by appending ?file:// to their own URL, tricking the browser into globally blocking JavaScript and CSS on cross-origin iframes. This allows bypassing legacy frame-busting scripts to facilitate clickjacking attacks.
Affected files:
ios/web/web_state/ui/wk_content_rule_list_util.mm
Estimated timestamp from git blame: 2021-01-27
Description
In ios/web/web_state/ui/wk_content_rule_list_util.mm, the function CreateLocalBlockingJsonRuleList() generates JSON rules for Apple's WKContentRuleList to prevent local or privileged schemes from loading remote HTTP/HTTPS subresources.
The if-top-url trigger condition is populated with an array of regular expressions representing these local schemes, such as file://.* and chrome://.*. However, in WebKit Content Blocker semantics, regular expressions are unanchored by default. Because these strings lack the ^ start anchor, WebKit interprets them as matching any top-level URL that contains the substring file:// or chrome:// anywhere within it.
Crucially, the rule's resource-type array explicitly excludes document (to avoid breaking error pages). This means that if an attacker hosts a malicious page with ?file:// in the URL and frames a victim site, the victim iframe document itself will load, but all of its subsequent script, style-sheet, and image requests will match the rule's https?://.* filter and be silently blocked by the browser.
Impact
This vulnerability provides an attacker with a universal primitive to selectively disable JavaScript and CSS on any cross-origin site framed on their page. This can be weaponized to reliably bypass legacy JS-based frame-busting logic, intentionally break site layouts, or perform UI redressing/clickjacking attacks against authenticated sessions on target websites that do not utilize modern X-Frame-Options or CSP: frame-ancestors protections.
Potential Reproduction Steps
Note: The following are suggested potential steps to trigger the vulnerability. Our tooling agent does not yet have the ability to run code to produce a working proof of concept.
- Identify a target victim website (e.g.,
https://victim.com/sensitive-action) that relies on JavaScript for frame-busting or UI security enforcement. - Create a malicious webpage at
https://attacker.com/exploit.htmlthat embeds the victim's site in an iframe:<iframe src="https://victim.com/sensitive-action"></iframe>. - Entice a victim using iOS Chrome to visit the exploit page with a privileged scheme string appended to the URL, such as:
https://attacker.com/exploit.html?file://. - When the browser navigates to the attacker's URL, the
if-top-urlcondition for the local-blocking rule evaluates to true becausefile://is present in the query string. - The iframe document loads successfully (as
documentis excluded from the block list), but WebKit silently aborts all subsequent requests for the victim's scripts and stylesheets. - The attacker can now overlay transparent elements over the neutered victim iframe to perform clickjacking.
Suggested Fix
Explicitly anchor the regular expressions generated in CreateLocalBlockingJsonRuleList() with the ^ character to ensure they only match when the URL starts with the specified scheme.
// In ios/web/web_state/ui/wk_content_rule_list_util.mm
NSMutableArray* local_schemes_urls = [@[ @"^file://.*" ] mutableCopy];
// ...
for (std::string scheme : schemes.standard_schemes) {
[local_schemes_urls addObject:base::SysUTF8ToNSString("^" + scheme + "://.*")];
}
Evaluated with Chrome root at commit: cc901875d53bf4e4fe0e01f02843871da4106e70
Results so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The regular expressions in the if-top-url trigger lacked a start anchor, so WebKit matched them against any URL containing the scheme substring rather than only URLs beginning with it.
Impact
An attacker could selectively disable JavaScript and CSS on any cross-origin site framed on their page, potentially bypassing legacy frame-busting and enabling clickjacking against sites without modern frame protections; the report notes the tooling did not produce a working proof of concept.
What the attacker needed
Victim uses Chrome on iOS; victim visits attacker page; target site lacks X-Frame-Options or CSP frame-ancestors
The fix
The regular expressions should be anchored with a leading ^ so they only match URLs that start with the scheme.
How it was found
- Pick a victim site that relies on JavaScript for frame-busting.
- Create an attacker page that embeds the victim site in an iframe.
- Send the victim to the attacker page with file:// appended to the URL.
- The iframe document loads but its scripts and stylesheets are blocked.
- Overlay transparent elements on the neutered iframe to clickjack.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Chrome on iOS uses a list of rules to block certain content. Those rules matched too loosely: any web address that merely contained the text file:// was treated as a local page. By putting that text in their own link, an attacker could make Chrome block the scripts and styles of a site they framed, which can help them trick users into clicking things they did not intend to.
What is UI spoofing?
The interface lies to the user: a framed page catches their clicks, or a browser shows the wrong address or a fake prompt. Paid when it leads to a sensitive action or convincing phishing.