Skip to content
XSS Advisory Advanced CVE-2026-17797

Inappropriate implementation in CSS (CVE-2026-17797)

The CSS serialization for the ::picker() pseudo-element appends its decoded argument without re-escaping, so a crafted CSS string can break out of the pseudo-element syntax. If an application reflects the serialized CSS back into a style context, an attacker could inject arbitrary CSS rules, potentially leading to mutation XSS for UI redressing or data exfiltration.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 2 months

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 ::picker() pseudo-element fails to escape its argument during CSS serialization. If a web application parses and reflects this serialized CSS, an attacker can use CSS escape sequences to inject arbitrary CSS rules. This could lead to Mutation Cross-Site Scripting (mXSS), allowing for data exfiltration or UI redressing.

Affected files:

  • third_party/blink/renderer/core/css/css_selector.cc

Estimated timestamp from git blame: 2026-03-31

Vulnerability Details

A potential CSS mutation vulnerability (mXSS) exists in the serialization logic for the ::picker() pseudo-element within third_party/blink/renderer/core/css/css_selector.cc.

When the Blink CSS parser processes a ::picker() functional pseudo-element, it decodes any CSS escape sequences in its argument and stores the unescaped raw string internally. However, during CSS Object Model (CSSOM) serialization (e.g., when a script reads cssRule.cssText or selectorText), the CSSSelector::SerializeSimpleSelector function appends the argument directly to the output buffer without re-escaping it.

C++
      case kPseudoPicker:
      case kPseudoOverscrollAreaParent:
      case kPseudoScrollButton: {
        builder.Append('(');
        // These accept only fixed arguments that do not require escaping (in
        // some cases including "*" which should not be escaped).
        builder.Append(Argument()); // Bug: Raw string appended without escaping
        builder.Append(')');
        break;
      }

Unlike other pseudo-classes (such as :dir() or :state()) which correctly use SerializeIdentifier(Argument(), builder), the raw concatenation here allows an attacker to break out of the pseudo-element syntax if the serialized CSS is later reflected into a <style> tag by a web application.

Potential Steps to Trigger

Note: These are suggested steps based on code analysis; our tooling agent does not currently have the capability to run a live proof-of-concept to verify execution in a full browser environment.

  1. Payload Injection: An attacker provides a malicious CSS string to a vulnerable web application that parses, serializes, and later reflects CSS. The payload uses CSS escape sequences to smuggle syntax characters: div::picker(\29 \7b \7d * \7b color\3a red\3b \7d ) {}
  2. Internal Decoding: The parser processes the argument, unescaping \29 to ), \7b to {, etc. The internal token value becomes ) {} * { color: red; }.
  3. Serialization: The application accesses the CSSOM (e.g., rule.cssText). SerializeSimpleSelector emits the unescaped string, generating: div::picker() {} * { color: red; }) {}.
  4. Reparsing and Execution: The application writes the serialized string back to the DOM. The browser parses it as three segments:
    • div::picker() {} (Syntactically valid rule)
    • * { color: red; } (Injected arbitrary CSS rule)
    • ) {} (Safely ignored via parser error recovery)

Through this CSS injection, an attacker could potentially achieve UI redressing or data exfiltration (e.g., using attribute selectors to read and leak sensitive CSRF tokens or user data to an external server).

Suggested Fix

Update CSSSelector::SerializeSimpleSelector in third_party/blink/renderer/core/css/css_selector.cc.

The safest approach is to handle kPseudoPicker by utilizing SerializeIdentifier(Argument(), builder) instead of directly appending Argument(), ensuring that any special characters are correctly escaped according to CSS serialization rules (similar to how kPseudoState and kPseudoDir are handled).

Alternatively, if ::picker() is only ever meant to accept a fixed internal keyword (e.g., select), the parser (CSSSelectorParser::ConsumePseudo) should be updated to strictly reject arbitrary identifiers and ensure the argument is exactly from the allowed keyword set.

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 serialization code for the ::picker() pseudo-element appends the decoded argument directly instead of using the identifier-escaping helper used by similar pseudo-classes.

Impact

Through this CSS injection, an attacker could potentially achieve UI redressing or data exfiltration, though the report notes the steps are based on code analysis and were not verified in a live browser.

What the attacker needed

Web app parses, serializes and reflects CSS; attacker can supply CSS input

The fix

The serialization should use the identifier-escaping helper for the ::picker() argument, or the parser should strictly reject arbitrary identifiers.

How it was found

  1. An attacker supplies a malicious CSS string to a web application that parses, serializes, and later reflects CSS.
  2. The CSS parser decodes escape sequences in the ::picker() argument into raw syntax characters.
  3. The application reads the serialized CSS from the CSSOM, which emits the unescaped argument.
  4. The application writes the serialized string back into the DOM, where the browser reparses it and treats part of it as an injected CSS rule.

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 and then writes it back out as text, it is supposed to escape special characters so the text cannot be misinterpreted later. Here, one specific CSS feature called ::picker() writes its contents back without that protection. If a website takes that text and puts it back into a page, an attacker could sneak in extra CSS rules that change how the page looks or behaves.

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.