# GHSA-X43W-36PP-96G3: Missing case-insensitive matching for CSS url function

- Database: GitHub
- Severity: CVSS 5.4 (Medium)
- Published: 2026-10-17
- Modified: 2026-10-17

## Affected versions

- ammonia (crates.io): from 4.2.0, fixed in 4.2.4

## Description

### Summary

URL filtering, such as relative URLs and URL scheme limits, is not always applied when CSS sanitization is used.

### Details

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.

### Proof of concept

```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>"#);
```

### Impact

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.

## References

- https://github.com/rust-ammonia/ammonia/security/advisories/GHSA-x43w-36pp-96g3

Page: https://cve.now/GHSA-X43W-36PP-96G3

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
