Insufficient policy enforcement in CSS (CVE-2026-11162)
A security mechanism in Blink's CSS engine that tracks tainted values from attr() is bypassed when the attr() is used inside a shorthand property, because the taint ranges are dropped during re-parsing. An attacker who can inject CSS could therefore exfiltrate sensitive DOM attribute values, such as a CSRF token, via a network request.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 51 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 potential vulnerability exists in Blink's CSS engine where the attr-taint security mechanism is bypassed when using shorthand properties. Taint ranges are dropped during the re-parsing of resolved substitutions, stripping the security context. An attacker with CSS injection could exploit this to exfiltrate sensitive DOM attributes.
Affected files:
third_party/blink/renderer/core/css/resolver/style_cascade.ccthird_party/blink/renderer/core/css/parser/css_parser_token_stream.h
Estimated timestamp from git blame: 2024-09-04
Description
Initial CSS parsing logic and cascade resolution parameters for shorthand properties are validated. When encountering unparsed variable or attr() functions within a shorthand, the engine correctly handles the CSSPendingSubstitutionValue and initiates token resolution via ResolveTokensInto. Standard processing is applied for DOM attribute extraction and token sequence generation, successfully recording the attr() taint tracking metadata internally.
However, for the final resolution, the logic leaps directly to a flawed transformation. In third_party/blink/renderer/core/css/resolver/style_cascade.cc, StyleCascade::ResolvePendingSubstitution instantiates the parser stream used for longhand expansion as follows:
// style_cascade.cc:1446
CSSParserTokenStream stream2(sequence.OriginalText());
This constructor invocation omits the taint ranges. Unlike the longhand equivalent (ResolveVariableReference), which correctly passes sequence.GetAttrTaintedRanges(), this omission strips all taint tracking from the resulting stream. Consequently, subsequent security checks, such as stream.IsAttrTainted() in ConsumeImage, evaluate to false, neutralizing the CSS Values Level 5 attr() security mechanism.
Potential Reproduction Steps
Note: These are suggested/potential steps as our tooling agent does not yet have the ability to run code.
- Standard target initialization: A webpage containing a sensitive DOM attribute (e.g.,
<input name='csrf' value='SECRET123'>). - General CSS injection payload delivery: The attacker injects a stylesheet containing a shorthand property utilizing
attr(), such asinput[name=csrf] { background: image-set(attr(value)); }. - Standard style resolution cascade execution applied by the browser.
- Execution jumps to the untainted
CSSParserTokenStreamcreation, dropping theattr()security context and directly executing the network fetch to the attacker's origin using the attribute's value.
Suggested Fix
Update StyleCascade::ResolvePendingSubstitution to preserve taint ranges during stream construction:
CSSParserTokenStream stream2(sequence.OriginalText(), sequence.GetAttrTaintedRanges());
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.
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
Likely, the constructor for the parser stream used during shorthand expansion does not receive the taint ranges, unlike the longhand path, so the taint metadata is lost.
Impact
An attacker with CSS injection could exfiltrate sensitive DOM attributes, though the report notes the reproduction steps are suggested and have not been run.
What the attacker needed
Attacker can inject CSS into the page; target page has sensitive DOM attributes
The fix
The fix should pass the taint ranges when constructing the parser stream in StyleCascade::ResolvePendingSubstitution.
How it was found
- A webpage contains a sensitive DOM attribute, such as a CSRF token in an input element.
- The attacker injects a stylesheet with a shorthand property that uses attr() to reference that attribute.
- The browser resolves the style cascade for the element.
- The engine creates an untainted parser stream, drops the attr() security context, and performs a network fetch to the attacker's origin using the attribute value.
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.
Web pages can use a CSS function called attr() to read an attribute from an HTML element, for example the value of an input field. To stop this being abused, the browser marks such values as 'tainted' so they cannot be used to trigger network requests. This report says that when attr() appears inside a shorthand CSS property, the taint mark is lost, so an attacker who can add CSS to a page could make the browser send the secret value to their own server.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.