GHSA-69v2-w9vg-4g83
Not scored
Incorrect escaping for `url("")` functions in CSS style attributes
- Severity
- Not scored
- Published
- Last changed
- Also known as
- RUSTSEC-2021-0157
Description
In some cases, quotation marks in CSS url() functions are not escaped. This allows CSS injection. This feature is not enabled by default, so an application is vulnerable if, and only if, the style attribute is allowed and filter_style_properties is used.
As an example, this snippet:
<div style='background:url("cid:\");EVIL_CSS_HERE;background:url(\"cid:")'>
Would erroneously "sanitize" to:
<div style='background:url("cid:");EVIL_CSS_HERE;background:url("cid:")'>
This vulnerability was reported by Uttej Badwane
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| ammonia (crates.io) | from 0.0.0-0 before 4.1.7, from 4.2.0 before 4.2.3 | RustSec Advisory Database |
References
Sources
| Source | Record | Licence |
|---|---|---|
| RustSec Advisory Database | RUSTSEC-2021-0157 changed 2026-10-12 | CC0-1.0 |