RUSTSEC-2026-0373None▾ SunlitMissing case-insensitive matching for CSS url function
▾ Sunlit zone — Low / medium · no exploitation signal
impact 2.8 · likelihood 0 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via OSV
Last analysed / modified upstream
URL filtering, such as relative URLs and URL scheme limits, is not always applied when CSS sanitization is used.
When the inner URL is quoted, CSS url("") is matched case-sensitively,
when it should be matched case-insensitively.
As a result, while url("") gets the intended domain name filtering,
URL("") does not.
The following example shows how an application needs to be configured to trigger this bug.
let mut builder = Builder::new();
// allow inline styles
builder.filter_style_properties(hashset!["background-image"]);
builder.add_generic_attributes(&["style"]);
// notice that "http" URLs aren't allowed
builder.url_schemes(["cid"].into());
// attacker-controlled, presumably
let cleaned = builder.clean(r#"<div style='background:URL("https://evil.com/ping");'>"#);
// this is the expected result
assert_eq!(String::from(&cleaned), r#"<div style="">ok</p>"#);
// this is the result that the vulnerable version actually gets
assert_eq!(String::from(&cleaned), r#"<div style="background-image:URL("https://evil.com/ping");">ok</p>"#);
This can be used to inject tracking pixels where the application intended to prevent them. It does not allow XSS, and its usefulness for data exfiltration is limited.
This vulnerability was reported by Louis Li.
ammonia >= 4.2.0, < 4.2.4Upgrade to a patched release:
ammonia 4.2.4Connected by shared product, vendor, weakness, or advisory.
RUSTSEC-2021-0158NoneXSS in ammonia via SVG `animateMotion`, `animateTransform`, and/or `animateColor` tags
RUSTSEC-2021-0157NoneIncorrect escaping for `url("")` functions in CSS style attributes
CVE-2026-102342Medium· 5.4ammonia is a Rust library for repairing and securing untrusted HTML
RUSTSEC-2026-0213NoneXSS in ammonia via SVG `animate` and `set` animation tags
CVE-2026-63430Medium· 6.3ammonia is a Rust library for repairing and securing untrusted HTML