Skip to content
XSS Advisory Advanced CVE-2026-11292

Policy bypass in Blink (CVE-2026-11292)

A logic flaw in Blink's HTML parser allows speculative preloads to bypass a restrictive <meta> Content Security Policy when an HTTP CSP header is also present. An attacker could exfiltrate data or initiate cross-origin fetches that the <meta> CSP intended to block.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 50 days

Project Fortify, 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.

Overview: A logic flaw in HTMLDocumentParser allows speculative preloads to bypass a restrictive <meta> Content Security Policy. The parser incorrectly compares the total number of applied CSP policies (which includes HTTP headers) against the count of <meta> CSP tags seen by the preload scanner. If a page has an HTTP CSP header and a <meta> CSP tag, preloads can be dispatched before the <meta> tag's policy is actually enforced.

Affected files:

  • third_party/blink/renderer/core/html/parser/html_document_parser.cc
  • third_party/blink/renderer/core/html/parser/html_preload_scanner.cc
  • third_party/blink/renderer/core/frame/csp/content_security_policy.cc
  • third_party/blink/renderer/core/loader/document_loader.cc
  • third_party/blink/renderer/core/loader/http_equiv.cc

Estimated timestamp from git blame: 2025-03-26

Summary

A potential vulnerability exists in the speculative preloading logic of Blink's HTML parser when the experimental AllowPreloadingWithCSPMetaTag feature is enabled.

The HTMLDocumentParser::AllowPreloading() function attempts to gate speculative preloads until all CSP <meta> tags discovered by the preload scanner have been fully processed by the HTML tree builder. However, the synchronization logic is flawed: it compares the total count of parsed CSP policies (which includes policies delivered via HTTP response headers) against the number of <meta> CSP tags encountered by the scanner. If an HTTP CSP policy is present, the equality check can pass prematurely, allowing preloads to bypass a restrictive <meta> CSP tag.

Technical Details

In third_party/blink/renderer/core/html/parser/html_document_parser.cc, the AllowPreloading() function contains the following check:

C++
return static_cast<int>(csp->GetParsedPolicies().size()) == seen_csp_meta_tags_;
  1. csp->GetParsedPolicies().size(): This returns the total number of policies in the ContentSecurityPolicy object. Crucially, this vector is populated at navigation commit with any policies derived from HTTP headers (including Content-Security-Policy-Report-Only).
  2. seen_csp_meta_tags_: This counter is incremented by the HTMLPreloadScanner only when it encounters a <meta http-equiv="content-security-policy"> tag in the HTML markup.

Because these two values measure different things, an attacker can manipulate them to match prematurely.

Potential Attack Scenario

Note: The following steps describe a theoretical attack sequence based on code analysis; a functional exploit has not been executed.

  1. The attacker serves (or finds) a page that returns an HTTP response header, such as Content-Security-Policy-Report-Only: default-src 'self'. During navigation commit, this policy is added, so GetParsedPolicies().size() equals 1.
  2. The attacker injects HTML (e.g., via XSS) containing a restrictive CSP meta tag: <meta http-equiv="content-security-policy" content="default-src 'none'">.
  3. Immediately following the meta tag, the attacker injects a resource load that would normally be blocked, e.g., {{media:0}}.
  4. The HTMLPreloadScanner scans the markup. It sees the <meta> tag and increments seen_csp_meta_tags_ to 1.
  5. The scanner queues the attacker's <img> preload and yields back to the HTMLDocumentParser.
  6. The parser calls AllowPreloading() to see if the queued preload can be dispatched.
  7. The check !csp->IsActive() is bypassed because IsActive() returns true if any policy is present (including the header).
  8. The parser evaluates GetParsedPolicies().size() == seen_csp_meta_tags_. Since both are 1, it incorrectly returns true.
  9. The attacker's speculative preload is dispatched over the network to attacker.example, successfully bypassing the restrictive <meta> CSP.
  10. Later, the main HTML tree builder processes the <meta> tag and adds its policy (bringing GetParsedPolicies().size() to 2), but it is too late to block the leak.

Impact

This results in a renderer-side CSP bypass, allowing an attacker to exfiltrate data or initiate cross-origin fetches that the page's <meta> CSP intended to block. The impact is currently limited by the fact that the AllowPreloadingWithCSPMetaTag runtime feature is experimental.

Suggested Fix

To fix this synchronization issue, the parser must compare comparable counts.

One approach is to track the number of parsed meta tag policies specifically. ContentSecurityPolicy could maintain a separate counter or expose a method like GetParsedMetaPoliciesCount() that AllowPreloading() checks against seen_csp_meta_tags_.

Alternatively, seen_csp_meta_tags_ could be initialized at navigation commit to the number of HTTP header policies present, effectively transforming it into an expected_total_policies_ counter.

Evaluated with Chrome root at commit: 096fc8fdbfacf2546485756d03f160a3d04fcc9b


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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 parser compares the total number of parsed CSP policies (including HTTP headers) with the number of <meta> CSP tags seen by the preload scanner, so the counts can match prematurely.

Impact

This could allow an attacker to exfiltrate data or initiate cross-origin fetches that the page's <meta> CSP intended to block, though the impact is limited because the feature is experimental.

What the attacker needed

Experimental feature enabled; attacker can inject HTML; page has an HTTP CSP header

The fix

The parser should compare comparable counts, for example by tracking the number of parsed meta tag policies separately or by initialising the seen meta tag counter to the number of HTTP header policies.

How it was found

  1. The attacker serves a page with an HTTP CSP header, such as Content-Security-Policy-Report-Only: default-src 'self'.
  2. The attacker injects HTML containing a restrictive CSP meta tag.
  3. Immediately after the meta tag, the attacker injects a resource load that would normally be blocked.
  4. The preload scanner sees the meta tag, increments its counter, and queues the resource preload.
  5. The parser checks AllowPreloading(), and because the policy count equals the meta tag count, it allows the preload.
  6. The preload is dispatched over the network, bypassing the meta CSP.

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.

Content Security Policy (CSP) is a rule that tells the browser which resources a page may load. This report found that when a page has both a CSP header and a CSP meta tag, the browser could start loading some resources before it had applied the meta tag's rules. That means an attacker who can inject HTML could make the browser fetch data to an outside server even though the page's CSP was supposed to stop it.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.