Skip to content
XSS Advisory Advanced CVE-2026-14145

Inappropriate implementation in CSS (CVE-2026-14145)

A CSS serialisation function in Chromium's experimental CSS random() feature appends identifier strings without escaping, so an attacker-supplied escaped identifier can break out of the function context when the style is re-serialised. The report claims this could allow an injected CSS declaration to be applied, though the steps are described as potential and were not executed.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 43 days

Flapjack, 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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A potential CSS declaration injection exists because RandomName::CssText() appends raw identifier strings instead of using SerializeIdentifier. An attacker can use escape sequences to embed payload characters that are serialized raw, breaking out of the function context. This impacts the experimental CSSRandomFunction feature.

Affected files:

  • third_party/blink/renderer/core/css/css_math_expression_node.h

Estimated timestamp from git blame: 2025-11-24

Final Result / Core Issue

A potential CSS declaration injection (mXSS) vulnerability is triggered because RandomName::CssText() in third_party/blink/renderer/core/css/css_math_expression_node.h serializes identifier cache keys raw without escaping.

Potential Trigger Steps

  1. Initial logic and parameters are validated: A CSS payload utilizing escaped identifiers (e.g., width: random(--foo\29 \3b \20 color\3a red\3b , 1px, 2px);) is correctly decoded by the tokenizer, and the unescaped literal string --foo); color:red; is stored in the ident field of the RandomName struct.
  2. Standard AST node allocation and property value cache population applied.
  3. During CSS serialization (e.g., via element.style.cssText), execution jumps directly to RandomName::CssText(), which evaluates result.Append(ident);. This emits the raw payload string without invoking SerializeIdentifier, producing the mutated string random(--foo); color:red;, 1px, 2px).
  4. The subsequent re-parsing of this string prematurely closes the random() context and successfully applies the injected color:red; declaration.

Note: These are suggested/potential steps, as our tooling agent doesn't yet have the ability to run code.

Suggested Fix

Modify RandomName::CssText() to use SerializeIdentifier(ident, result); (defined in third_party/blink/renderer/core/css/css_markup.h) instead of result.Append(ident);.

Evaluated with Chrome root at commit: b7d0c4d810da1b31400f198c70d9720fc8f0e5a0


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

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 serialiser for the random() function's name argument appends the stored identifier directly instead of escaping it with the standard identifier serialiser.

Impact

If the described behaviour is real, an attacker could cause an extra CSS declaration to be applied after a style is serialised and re-parsed; the report does not demonstrate execution and the feature is experimental.

What the attacker needed

Experimental CSSRandomFunction feature enabled; attacker can supply CSS that is serialised and re-parsed

The fix

The serialiser should escape the identifier using the standard identifier serialisation helper instead of appending it raw.

How it was found

  1. Supply a CSS value using the random() function whose identifier contains escape sequences that decode to closing parenthesis, semicolon and a new declaration.
  2. The tokenizer decodes the escapes and stores the unescaped literal string in the RandomName identifier field.
  3. Trigger serialisation of the style, for example by reading element.style.cssText.
  4. The serialiser emits the raw identifier, producing a string where the random() call is closed early and the injected declaration appears.
  5. Re-parsing that string applies the injected declaration.

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.

When a browser reads CSS, it sometimes has to write the CSS back out as text, for example when a script reads element.style.cssText. If the code that writes it out forgets to escape special characters, a value that was safely stored can turn into extra CSS rules when it is read back. Here the report says a crafted escaped identifier could smuggle in an extra declaration such as a colour change.

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.