Insufficient policy enforcement in CSS (CVE-2026-11155)
A CSS engine flaw allows the security taint flag on values from attr() to be stripped via discrete transitions on registered custom properties. An attacker could then use the laundered value in a sensitive sink like image-set() to exfiltrate sensitive attribute data such as a CSRF token.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 52 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 in Blink's CSS engine allows bypassing the attr()-security control by using discrete transitions on registered custom properties. The issue occurs because transition endpoints are snapshotted as typed CSS values, which strips the is_attr_tainted flag. This could permit the exfiltration of sensitive attribute values via CSS-only techniques.
Affected files:
third_party/blink/renderer/core/css/properties/longhands/custom_property.ccthird_party/blink/renderer/core/animation/css/css_animations.ccthird_party/blink/renderer/core/css/resolver/style_cascade.ccthird_party/blink/renderer/core/animation/css_default_interpolation_type.ccthird_party/blink/renderer/core/css/css_syntax_definition.ccthird_party/blink/renderer/core/css/properties/css_parsing_utils.ccthird_party/blink/renderer/core/css/css_attr_type.cc
Estimated timestamp from git blame: 2025-04-02
Summary
A potential vulnerability exists in Blink's CSS implementation that allows for the laundering of the is_attr_tainted flag. This flag is a security mechanism designed to enforce the attr()-security control, preventing values derived from HTML attributes via attr() from being used in sensitive contexts like URLs. By leveraging discrete transitions on registered custom properties, an attacker can strip the taint from a value, bypassing these security checks and potentially exfiltrating sensitive data.
Technical Details
- The
attr()-securitycontrol marks tokens substituted fromattr()as tainted. This boolean flag (is_attr_tainted_) is stored withinCSSVariableData. - When a registered custom property (e.g., with syntax
<string>) is assigned anattr()value,CustomProperty::ApplyValueparses it into a typedCSSValue(likeCSSStringValue).CSSValuedoes not store the taint flag. However,ApplyValuecorrectly creates and stores a parallelCSSVariableDataon theComputedStylewith the taint preserved. - If a CSS transition with
transition-behavior: allow-discreteis triggered on this property, the animation engine calculates endpoints usingAnimationUtils::KeyframeValueFromComputedStyle. This function retrieves the computed typedCSSValue(CSSStringValue), which lacks the taint information. - During the animation,
CSSDefaultInterpolationType::Applypasses this untaintedCSSStringValueback intoCustomProperty::ApplyValue. - Inside
CustomProperty::ApplyValue, the code attempts to cast the value to aCSSUnparsedDeclarationValueto extract the taint:const auto* declaration = DynamicTo<CSSUnparsedDeclarationValue>(value);. - Because the incoming value is a
CSSStringValue, the cast fails (declarationisnullptr), andis_attr_taintedis incorrectly evaluated asfalse. - A new, untainted
CSSVariableDatais created and stored on theComputedStyle. - If this laundered custom property is subsequently used in a sensitive sink via
var()(e.g.,image-set()), the security check incss_parsing_utils::ConsumeImage(stream.IsAttrTainted()) evaluates tofalse, allowing the URL to be fetched.
Suggested Attacker Steps (Note: These are suggested steps; our tooling agent does not yet have the ability to run code to confirm a working exploit).
-
Define a registered custom property with
<string>syntax.CSS @property --s { syntax: "<string>"; inherits: false; initial-value: "initial"; } -
Apply the custom property using
attr()to target an attribute containing sensitive data (e.g., a CSRF token inhref). -
Trigger a discrete transition to launder the value.
CSS a[href] { --s: attr(href); transition: --s 0.001s allow-discrete; background-image: image-set(var(--s) 1x); } @starting-style { a[href] { --s: "initial"; } } -
The transition launders the taint, and the browser incorrectly issues a GET request to the attacker's server with the sensitive attribute data.
Suggested Fix
To resolve this, the taint state (is_attr_tainted) must be preserved when custom properties are resolved into typed CSSValue objects, or the animation system must be updated to retrieve and preserve the original CSSVariableData for registered custom properties when taking keyframe snapshots. Alternatively, CSSValue could be augmented to carry the taint bit, ensuring that it is never lost when converting between unparsed token sequences and typed values.
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 taint flag is lost when a registered custom property is converted to a typed CSSValue for animation, and the code that reapplies the value does not restore it.
Impact
This could permit the exfiltration of sensitive attribute values via CSS-only techniques, though the exploit has not been confirmed.
What the attacker needed
Victim visits a malicious page; sensitive data in an HTML attribute; browser supports discrete transitions
The fix
The taint state should be preserved when custom properties are resolved into typed CSSValue objects, or the animation system should retrieve and preserve the original CSSVariableData for registered custom properties when taking keyframe snapshots.
How it was found
- Define a registered custom property with string syntax.
- Assign the property using attr() to read a sensitive attribute such as href.
- Trigger a discrete transition on the property to launder the taint.
- Use the laundered property in a sensitive sink like image-set().
- The browser issues a request to the attacker's server with the sensitive data.
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.
CSS has a safety feature that marks values taken from HTML attributes as 'tainted' so they cannot be used in places like URLs. This report shows a way to remove that mark by animating a custom property, which could let an attacker steal secret values from a page. The attack is theoretical and has not been run.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.