# GHSA-x43w-36pp-96g3: Missing case-insensitive matching for CSS url function

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-10-16T12:00:00.000Z
- Modified: 2026-10-17T15:30:02.378Z
- Also known as: RUSTSEC-2026-0373

## Description

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.

```rust
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(&quot;https://evil.com/ping&quot;);">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](https://github.com/zhixuli0406).

(As written by RustSec Advisory Database.)

## Affected

- ammonia (crates.io): from 0.0.0-0 before 4.1.8; from 4.2.0 before 4.2.4

## References

- <https://crates.io/crates/ammonia> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0373.html> (advisory)
- <https://github.com/rust-ammonia/ammonia/pull/267> (web)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0373](https://rustsec.org/advisories/RUSTSEC-2026-0373.html), CC0-1.0, modified 2026-10-17

---

Page: https://cve.day/GHSA-x43w-36pp-96g3 · Whole record: https://cve.day/GHSA-x43w-36pp-96g3.json · Rebuilt by cve.day 2026-11-25T22:56:43.438Z
