Skip to content
XSS Advisory Advanced CVE-2026-11162

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.cc
  • third_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:

C++
// 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.

  1. Standard target initialization: A webpage containing a sensitive DOM attribute (e.g., <input name='csrf' value='SECRET123'>).
  2. General CSS injection payload delivery: The attacker injects a stylesheet containing a shorthand property utilizing attr(), such as input[name=csrf] { background: image-set(attr(value)); }.
  3. Standard style resolution cascade execution applied by the browser.
  4. Execution jumps to the untainted CSSParserTokenStream creation, dropping the attr() 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:

C++
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.

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

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

  1. A webpage contains a sensitive DOM attribute, such as a CSRF token in an input element.
  2. The attacker injects a stylesheet with a shorthand property that uses attr() to reference that attribute.
  3. The browser resolves the style cascade for the element.
  4. 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.

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.