Skip to content
XSS Advisory Advanced CVE-2026-13838

Inappropriate implementation in CSS (CVE-2026-13838)

Several CSS rule types in Blink fail to reattach their CSSOM wrappers and shallow-copy internal property sets during Copy-On-Write forks, allowing an attacker to mutate a shared cached stylesheet. An attacker could then inject styles into cross-origin documents that share the same renderer process.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 44 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: Multiple CSS rule types fail to properly reattach their CSSOM wrappers during Copy-On-Write (COW) forks and rely on shallow copying during rule cloning. This can allow an attacker to bypass immutability and poison shared, cached stylesheets in the MemoryCache. Consequently, an attacker could potentially inject malicious styles into cross-origin documents sharing the same renderer process.

Affected files:

  • third_party/blink/renderer/core/css/css_position_try_rule.cc
  • third_party/blink/renderer/core/css/css_font_feature_values_rule.cc
  • third_party/blink/renderer/core/css/css_property_rule.cc
  • third_party/blink/renderer/core/css/css_counter_style_rule.cc

Estimated timestamp from git blame: Unknown (Google3 checkout)

Summary

There is a logic flaw in Blink's CSS Copy-On-Write (COW) mechanism affecting several CSS rule types, most notably @position-try (CSSPositionTryRule) and @font-feature-values (CSSFontFeatureValuesRule). When a shared, cached stylesheet is mutated, Blink forks the stylesheet to keep the cached version immutable. However, due to shallow copying of internal rule properties and a failure to reattach CSSOM wrappers to the newly cloned rules, an attacker can maintain a reference to the shared internal property sets and arbitrarily mutate them. This leads to same-process cross-origin CSS poisoning.

Root Cause Analysis

When a script mutates a CORS-enabled shared stylesheet, a COW fork is initiated via CSSStyleSheet::WillMutateRules() -> StyleSheetContents::Copy().

There are two combined flaws that enable this vulnerability:

  1. Shallow Copying during Rule Cloning: During StyleSheetContents::Copy(), internal rules are cloned via StyleRuleBase::Clone(). For rule types like StyleRulePositionTry, the implicit default copy constructor is used (StyleRulePositionTry(const StyleRulePositionTry&) = default;). If an attacker previously accessed the .style property, MutableProperties() is called, making the underlying properties_ set mutable. The default copy constructor performs a shallow copy of the Member<CSSPropertyValueSet> properties_ pointer. As a result, both the original rule in the MemoryCache and the new cloned rule point to the exact same MutableCSSPropertyValueSet.

  2. Missing CSSOM Wrapper Reattachment: After cloning, CSSStyleSheet::ReattachChildRuleCSSOMWrappers() delegates to each rule's Reattach() method to update its internal pointers to the newly cloned rule. While safe rules like CSSStyleRule correctly reattach their child properties (properties_cssom_wrapper_->Reattach(...)), CSSPositionTryRule::Reattach() and others completely omit this step. Therefore, the CSSPositionTryDescriptors CSSOM wrapper retains a stale property_set_ pointer referencing the shared, now-mutable MutableCSSPropertyValueSet.

Subsequent mutations through the attacker's CSSOM wrapper bypass the COW protections and directly modify the shared MutableCSSPropertyValueSet. Any other document in the same renderer process (e.g., same-site origins, or any origin on Android where site isolation is relaxed) loading the same cached stylesheet will receive the attacker's injected styles.

Potential Exploitation Steps

(Note: These are suggested steps; our tooling agent does not yet have the ability to run code to confirm a working Proof of Concept).

  1. An attacker page embeds a common, cross-origin CORS-enabled stylesheet (e.g., a popular CSS framework from a CDN).
  2. Using JavaScript, the attacker retrieves the CSSPositionTryRule from the stylesheet's cssRules list.
  3. The attacker accesses the .style property (let s = rule.style;), which instantiates the CSSOM wrapper and forces the underlying property set to become mutable.
  4. The attacker mutates the style (e.g., s.marginTop = "100px";).
  5. This mutation triggers a COW fork. Because of the shallow copy, the MemoryCache's stylesheet and the attacker's stylesheet share the mutable property set.
  6. Because the CSSOM wrapper fails to reattach, subsequent modifications via s directly poison the shared property set in the MemoryCache.
  7. A victim navigating to a different origin in the same renderer process that relies on the same framework will have the poisoned CSS applied, potentially leading to UI spoofing or data exfiltration (e.g., using background-image requests to steal typed passwords).

Suggested Fix

  1. Fix Reattachment: Update CSSPositionTryRule::Reattach, CSSFontFeatureValuesRule::Reattach, CSSPropertyRule::Reattach, and CSSCounterStyleRule::Reattach to properly call Reattach() on their respective inner CSSOM wrappers (e.g., properties_cssom_wrapper_->Reattach(...)).
  2. Fix Shallow Copying: In StyleRuleBase::Clone, update the instantiation of affected rule types to safely handle properties, similar to StyleRule::Create. Instead of using default copy constructors, use Properties().ImmutableCopyIfNeeded() to ensure that the cloned rule does not inadvertently share a mutable property set with the cached original.

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 a combination of shallow copying of the internal property set during rule cloning and a failure to reattach CSSOM wrappers after a Copy-On-Write fork.

Impact

A victim visiting another origin in the same renderer process that uses the same stylesheet could have the poisoned CSS applied, potentially leading to UI spoofing or data exfiltration; on Android, where site isolation is relaxed, this could affect any origin.

What the attacker needed

Attacker-controlled web page; victim shares renderer process; victim loads same cached stylesheet

The fix

The affected Reattach methods should call Reattach on their inner CSSOM wrappers, and cloning should use an immutable copy of the property set instead of a default shallow copy.

How it was found

  1. An attacker page embeds a cross-origin CORS-enabled stylesheet.
  2. The attacker retrieves a CSSPositionTryRule from the stylesheet's cssRules list.
  3. The attacker accesses the rule's .style property to make the underlying property set mutable.
  4. The attacker mutates the style, triggering a Copy-On-Write fork.
  5. Because of the shallow copy, the cached stylesheet and the attacker's stylesheet share the mutable property set.
  6. Because the CSSOM wrapper fails to reattach, further changes poison the shared property set in the MemoryCache.

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 web page changes a stylesheet that is shared with other pages, the browser is supposed to make a private copy so the original stays unchanged. Here, for some CSS rule types, the copy still points at the same internal data, so changes leak into the shared original. A malicious page could then alter how other sites look in the same browser process.

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.