{"id":"RUSTSEC-2026-0373","revision":"7bcc37f1dde54a1ca18969d2c63ee720","records":[{"revision":"7bcc37f1dde54a1ca18969d2c63ee720","observedAt":"2026-10-24T13:19:54.901+00:00","statement":{"source":"osv","id":"RUSTSEC-2026-0373","aliases":["GHSA-x43w-36pp-96g3"],"title":"Missing case-insensitive matching for CSS url function","description":"URL filtering, such as relative URLs and URL scheme limits,\nis not always applied when CSS sanitization is used.\n\nWhen the inner URL is quoted, CSS `url(\"\")` is matched case-sensitively,\nwhen it should be matched case-insensitively.\nAs a result, while `url(\"\")` gets the intended domain name filtering,\n`URL(\"\")` does not.\n\nThe following example shows how an application needs to be configured\nto trigger this bug.\n\n```rust\nlet mut builder = Builder::new();\n// allow inline styles\nbuilder.filter_style_properties(hashset![\"background-image\"]);\nbuilder.add_generic_attributes(&[\"style\"]);\n// notice that \"http\" URLs aren't allowed\nbuilder.url_schemes([\"cid\"].into());\n\n// attacker-controlled, presumably\nlet cleaned = builder.clean(r#\"<div style='background:URL(\"https://evil.com/ping\");'>\"#);\n\n// this is the expected result\nassert_eq!(String::from(&cleaned), r#\"<div style=\"\">ok</p>\"#);\n\n// this is the result that the vulnerable version actually gets\nassert_eq!(String::from(&cleaned), r#\"<div style=\"background-image:URL(&quot;https://evil.com/ping&quot;);\">ok</p>\"#);\n```\n\nThis can be used to inject tracking pixels where the application intended to prevent them.\nIt does not allow XSS, and its usefulness for data exfiltration is limited.\n\n---\n\nThis vulnerability was reported by [Louis Li](https://github.com/zhixuli0406).","state":0,"publishedAt":"2026-10-16T12:00:00+00:00","modifiedAt":"2026-10-17T15:30:02.378212+00:00","affected":[{"ecosystem":"crates.io","name":"ammonia","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.0.0-0"},{"kind":"fixed","version":"4.1.8"},{"kind":"introduced","version":"4.2.0"},{"kind":"fixed","version":"4.2.4"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://crates.io/crates/ammonia","https://rustsec.org/advisories/RUSTSEC-2026-0373.html","https://github.com/rust-ammonia/ammonia/pull/267"],"sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2026-0373","license":"OSV · upstream source license applies","key":"osv:RUSTSEC-2026-0373","identifiers":["RUSTSEC-2026-0373","GHSA-x43w-36pp-96g3"]},"retained":false,"historicalAffected":[]}],"coverage":[]}