Incorrect authorization in Blink (CVE-2026-120930)
Chrome's Blink engine did not properly enforce a strict Content Security Policy for external module scripts when 'strict-dynamic' was present. An attacker able to inject HTML could use a modulepreload link to get an external module script executed without a valid nonce or hash, bypassing the CSP that should have blocked it.
- Fix shipped in 5 months
VULNERABILITY DETAILS
Summary
Content Security Policy (CSP) is not properly enforced for external module scripts. Specifically, when 'strict-dynamic' is present, modulepreload may allow an attacker to execute external module scripts without a valid nonce or hash.
Attack Preconditions
The attacker can directly inject a <script> tag and a <link rel="modulepreload"> tag into the HTML content, or inject an <iframe srcdoc=...> with the above tags if the injection happens through innerHTML or similar APIs.
Impact Analysis
If a website's CSP hash-sources and nonce-sources are generated correctly, even if an attacker can inject arbitrary HTML content, they should not be able to make the nonce or integrity metadata match. Therefore, a strict CSP with 'strict-dynamic' should mitigate most XSS attacks if there are no script gadgets in the allowed sources. However, due to this vulnerability, an attacker can bypass the CSP and execute an external module script without a valid nonce or hash.
VERSION
Chrome Version: 148.0.7778.179 Stable
Operating System: Linux, Mac, Windows
This vulnerability is also present in Chrome 150.0.7853.0 Canary.
REPRODUCTION CASE
-
Create a directory structure like this with the attached files:
. └── index.html -
Run
python3 -m http.server 1337to start the server. -
Visit
http://localhost:1337/with Chrome.
Expected Behavior
The CSP in index.html: script-src 'none'; script-src-attr 'none'; script-src-elem 'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=' 'strict-dynamic'; should block the execution of document.body.textContent=`pwned: ${document.domain}`;.
If I understand correctly, the modulepreload fetch is expected to pass the CSP check. As per the HTML spec, the parser metadata in the script fetch options for a modulepreload request is considered not-parser-inserted. As per the CSP spec, not-parser-inserted requests should be allowed if strict-dynamic is present. However, since the parser metadata in the fetch options for <script type=module src=...> is parser-inserted, it should not be allowed to execute without a valid nonce or integrity metadata, even though the module is already preloaded.
Actual Behavior
document.body.textContent=`pwned: ${document.domain}`; is executed, although no meaningful JavaScript should be allowed with this CSP (sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= is the hash of an empty string.)
CREDIT INFORMATION
Reporter credit: lebr0nli of National Yang Ming Chiao Tung University, Dept. of CS, Security and Systems Lab.
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
Impact
An attacker who can inject HTML into a page protected by a strict CSP with 'strict-dynamic' could execute an external module script and run arbitrary JavaScript, defeating the policy's XSS mitigation.
What the attacker needed
Attacker can inject HTML into the page; site uses strict CSP with 'strict-dynamic'; no script gadgets in allowed sources
How it was found
- Create a directory containing the provided index.html file.
- Start a local web server on port 1337 with Python's http.server module.
- Open the local page in Chrome and observe that the script runs despite the strict 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.
A Content Security Policy is a rule set a website sends to the browser saying which scripts may run. A strict policy normally stops injected scripts from running unless they carry a secret value (a nonce) or match a known fingerprint (a hash). Here the browser wrongly let a script through because of a preloading feature, so an attacker who could inject HTML could run their own code despite the policy.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.