Skip to content
XSS Advisory Advanced CVE-2026-14147

Inappropriate implementation in CSS (CVE-2026-14147)

Blink's experimental RouteMatching feature serialises the :link-to() pseudo-class and @navigation rules by appending decoded strings without escaping. If a web application reflects the serialised CSS text, an attacker could break out of the rule and inject arbitrary CSS.

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: The experimental RouteMatching feature fails to properly escape internal strings during CSS serialization for the :link-to() pseudo-class and @navigation rules. Specifically, NavigationParamExpNode and NavigationLocation append raw strings rather than using standard serialization helpers. If a web application reflects the serialized .cssText, an attacker can bypass sanitizers to inject arbitrary CSS.

Affected files:

  • third_party/blink/renderer/core/css/link_condition.cc
  • third_party/blink/renderer/core/css/navigation_query.cc

Estimated timestamp from git blame: 2025-11-04

Summary

There is a potential CSS mutation Cross-Site Scripting (mXSS) vulnerability in the experimental RouteMatching feature. When serializing the :link-to() pseudo-class and @navigation rules, Blink fails to properly escape internal strings (such as parameter names, values, and locations) before appending them to the CSS output.

Technical Details

The vulnerability resides in the manual string concatenation within the SerializeTo methods for NavigationParamExpNode and NavigationLocation. Instead of utilizing standard CSS serialization helpers like SerializeIdentifier or SerializeString (which safely escape quotes, slashes, and structural characters), the code directly appends the decoded AtomicString members into a StringBuilder.

In third_party/blink/renderer/core/css/link_condition.cc (NavigationParamExpNode::SerializeTo):

C++
void NavigationParamExpNode::SerializeTo(StringBuilder& builder) const {
  if (value_) {
    builder.Append("\"");
    builder.Append(param_); // <--- Appends raw, decoded string
    builder.Append("\": \"");
    builder.Append(value_); // <--- Appends raw, decoded string
    builder.Append("\"");
  } else {
    // ...
  }
}

A similar issue exists in NavigationLocation::SerializeTo in third_party/blink/renderer/core/css/navigation_query.cc, where string_ is appended directly.

Potential Exploitation Steps

Note: Our tooling agent does not have the capability to run code; the following are suggested/potential steps an attacker would use to trigger this vulnerability based on source code analysis.

  1. Payload Delivery: An attacker supplies a crafted CSS payload to a vulnerable web application that parses and later reflects CSS rules using the browser's CSSOM (e.g., a CSS sanitizer or style editor). Payload: a:link-to(url(x) with foo\22 \3b \7d * \7b color: red; \7d \22 : \22 bar\22 ) { }
  2. Decoding: During initial parsing, the CSS Lexer decodes escape sequences (like \22 for " and \7d for }). The NavigationParamExpNode stores the literal, decoded string: foo"; } * { color: red; } ".
  3. Serialization: The web application reads the parsed rule back out via rule.cssText. The SerializeTo method emits the raw string without re-escaping it. Serialized Output: a:link-to(url("x") with "foo"; } * { color: red; } ": "bar") { }
  4. Execution (mXSS): The application injects this serialized string back into a <style> block. The first literal } prematurely closes the :link-to() rule, and the subsequent * { color: red; } is parsed and executed as a new, attacker-controlled CSS rule.

Impact

This flaw allows attackers to perform CSS injection (mXSS) against applications that rely on the browser's CSSOM serialization to sanitize or rewrite CSS. This feature is currently gated behind the experimental RouteMatching flag, limiting immediate production impact.

Suggested Fix

Refactor NavigationParamExpNode::SerializeTo and NavigationLocation::SerializeTo to use standard serialization helpers. Replace direct builder.Append(param_), builder.Append(value_), and builder.Append(string_) calls with SerializeString(param_, builder) or SerializeIdentifier(param_, builder) as appropriate for the CSS grammar context.

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 serialisation methods append decoded strings directly instead of using the standard CSS escaping helpers.

Impact

This could allow CSS injection against applications that rely on CSSOM serialisation to sanitise CSS, though the feature is gated behind an experimental flag, limiting immediate production impact.

What the attacker needed

Experimental RouteMatching flag enabled; app reflects CSSOM-serialised CSS; attacker can supply CSS input

The fix

The serialisation methods should be refactored to use the standard CSS escaping helpers instead of appending raw strings.

How it was found

  1. An attacker supplies crafted CSS to an application that parses and later reflects CSS via the browser's CSSOM.
  2. The CSS lexer decodes escape sequences and the node stores the decoded string.
  3. The application reads the rule back via cssText, which emits the raw unescaped string.
  4. The application injects that string into a style block, where the injected rule is parsed and applied.

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.

Browsers turn CSS into an internal tree and can write it back out as text. When writing it back, special characters like quotes and braces must be escaped, otherwise the text can be read as new rules. Here the browser forgot to escape, so a crafted stylesheet could smuggle extra CSS into anything that reuses the browser's rewritten text.

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.