Missing case-insensitive matching for CSS url function

ammonia Updated 17 Oct 2026

Summary

16/10/2026
N/A
Yes i
Unrated
Not published

RUSTSEC-2026-0373: Missing case-insensitive matching for CSS url function. Affects ammonia across 2 version ranges.

>= 0.0.0-0, < 4.1.8 >= 4.2.0, < 4.2.4

Fixed in 4.1.8 or 4.2.4, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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(&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.

How To Fix

Latest published version: 4.2.4 as of 22 Oct 2026

The newest release already contains this fix.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 0.0.0-0, < 4.1.8 4.1.8

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Share this vulnerability

Related vulnerabilities

Recent vulnerabilities recorded for ammonia.

How To Fix

Latest published version: 4.2.4 as of 22 Oct 2026

The newest release already contains this fix.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 0.0.0-0, < 4.1.8 4.1.8

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback