Inappropriate implementation in CSS (CVE-2026-17843)
A logic flaw in CSSUrlData::MakeComputed overwrites the raw relative URL with the canonicalised absolute URL, stripping newlines that trigger Blink's dangling markup detection. When the computed style is serialised and re-parsed, the dangling markup flag is lost, allowing a subresource load that should have been blocked and potentially exfiltrating page bytes.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
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. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A logical vulnerability in CSSUrlData::MakeComputed can potentially bypass Blink's dangling markup subresource-blocking defense. When generating a computed CSS URL value, the raw relative URL is erroneously overwritten with the canonicalized absolute URL where newlines are stripped. Subsequent serialization and re-parsing cycles of this value can cause the subresource load to bypass the security block.
Affected files:
third_party/blink/renderer/core/css/css_url_data.cc
Estimated timestamp from git blame: 2025-05-12
Description
There is a potential logical bypass of Blink's dangling markup subresource-blocking defense during the serialization and re-parsing of computed CSS URL values. When CSSUrlData::MakeComputed() clones a URL data instance for a computed style, it overwrites the relative_url_ (unresolved URL) with the canonicalized absolute_url_. Because URL canonicalization strips removable whitespace characters (such as \n, \r, and \t), the raw whitespace characters that originally triggered the dangling markup detection are lost. When this computed value is serialized and then parsed again by the browser, the new URL is not recognized as potentially dangling, allowing the subresource request to bypass the safety block.
Root Cause
In third_party/blink/renderer/core/css/css_url_data.cc:
const CSSUrlData* CSSUrlData::MakeComputed() const {
if (relative_url_.empty() || is_local_ || absolute_url_.empty()) {
return this;
}
return MakeGarbageCollected<CSSUrlData>(
base::PassKey<CSSUrlData>(), absolute_url_, absolute_url_, Referrer(),
is_from_origin_clean_style_sheet_, is_ad_related_, is_local_,
potentially_dangling_markup_, modifiers_);
}
Here, absolute_url_ is passed as both parameters 2 and 3 (the unresolved and resolved URL arguments). This overwrites the new object's relative_url_ with the canonicalized absolute URL string.
When CssText() is called, it serializes using relative_url_:
String CSSUrlData::CssText() const {
return SerializeURI(relative_url_, modifiers_);
}
Because relative_url_ was overwritten, the returned string contains the canonical absolute URL (where the raw newlines are absent). If this serialized string is re-parsed, the URL parser's whitespace checking code (in url/url_canon_etc.cc's DoRemoveUrlWhitespace) will not flag the new URL as potentially dangling since it lacks raw whitespace characters. Thus, the dangling markup flag is lost on re-parsing.
Potential Trigger Steps
(Note: These are potential, theoretical steps as our tooling does not currently have the capability to run code to verify with a live proof of concept)
- An attacker injects a CSS URL value containing unclosed quotes and a newline followed by a
<character (e.g.,url('/exfil?\a <secret'), where\ais the hex escape for a newline). - On the initial parse,
potentially_dangling_markup_is set totrue. When Blink tries to load the resource, the fetch is blocked inBaseFetchContext::CanRequestInternal()because the URL'sPotentiallyDanglingMarkup()flag istrue. - A script or layout operation triggers style resolution, creating a computed CSS value.
CSSImageValue::ComputedCSSValue()callsurl_data_->MakeComputed(), which incorrectly overwritesrelative_url_with the canonicalizedabsolute_url_(removing the newline). - The application triggers style serialization and re-parsing. For example, calling
animation.commitStyles()serializes the computed style viaCssText()and immediately sets it back on the element's inline style attribute. - The serialized CSS contains the canonicalized absolute URL string which has no raw newlines.
- Upon re-parsing, the new
KURLis constructed withPotentiallyDanglingMarkup()set tofalse. - Blink fetches the image resource successfully without blocking, potentially exfiltrating the captured page bytes.
Suggested Fix
Modify CSSUrlData::MakeComputed() to preserve the raw unresolved relative_url_ when potentially_dangling_markup_ is true, matching the logic implemented in MakeResolved():
const CSSUrlData* CSSUrlData::MakeComputed() const {
if (relative_url_.empty() || is_local_ || absolute_url_.empty()) {
return this;
}
return MakeGarbageCollected<CSSUrlData>(
base::PassKey<CSSUrlData>(),
potentially_dangling_markup_ ? relative_url_ : absolute_url_,
absolute_url_, Referrer(), is_from_origin_clean_style_sheet_,
is_ad_related_, is_local_, potentially_dangling_markup_, modifiers_);
}
Evaluated with Chrome root at commit: fb72408a8493c46bc75fae1c70d03daec96b3040
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, CSSUrlData::MakeComputed() passes the canonicalised absolute URL as both the unresolved and resolved URL, so the raw relative URL containing newlines is lost and the dangling markup flag is not preserved on re-parsing.
Impact
This could allow an attacker to bypass Blink's dangling markup subresource-blocking defence and exfiltrate captured page bytes, though the report notes the steps are theoretical and not verified with a live proof of concept.
What the attacker needed
Attacker can inject CSS URL value; application serialises and re-parses style; victim loads crafted page
The fix
Modify CSSUrlData::MakeComputed() to preserve the raw unresolved relative_url_ when potentially_dangling_markup_ is true, matching the logic in MakeResolved().
How it was found
- An attacker injects a CSS URL value containing unclosed quotes and a newline followed by a less-than character.
- On the initial parse, the potentially dangling markup flag is set and the resource fetch is blocked.
- A script or layout operation triggers style resolution, creating a computed CSS value via MakeComputed().
- The application triggers style serialisation and re-parsing, for example by calling animation.commitStyles().
- The serialised CSS contains the canonicalised absolute URL with no raw newlines.
- Upon re-parsing, the new URL is not flagged as potentially dangling and Blink fetches the image resource successfully.
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.
Dangling markup is a trick where an attacker injects an unclosed HTML attribute so the browser captures secret page content into a URL and sends it to the attacker. Browsers try to block this by refusing to load URLs that look like they contain such captured content. This report describes a way to make the browser forget that a URL was suspicious after it processes CSS styles, so the blocked request could go through.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.