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
- 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 theidentfield of theRandomNamestruct. - Standard AST node allocation and property value cache population applied.
- During CSS serialization (e.g., via
element.style.cssText), execution jumps directly toRandomName::CssText(), which evaluatesresult.Append(ident);. This emits the raw payload string without invokingSerializeIdentifier, producing the mutated stringrandom(--foo); color:red;, 1px, 2px). - The subsequent re-parsing of this string prematurely closes the
random()context and successfully applies the injectedcolor: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.
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
- Supply a CSS value using the random() function whose identifier contains escape sequences that decode to closing parenthesis, semicolon and a new declaration.
- The tokenizer decodes the escapes and stores the unescaped literal string in the RandomName identifier field.
- Trigger serialisation of the style, for example by reading element.style.cssText.
- The serialiser emits the raw identifier, producing a string where the random() call is closed early and the injected declaration appears.
- 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.