# GHSA-69v2-w9vg-4g83: Incorrect escaping for `url("")` functions in CSS style attributes

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2021-10-10T12:00:00.000Z
- Modified: 2026-10-12T18:15:01.959Z
- 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:

```html
<div style='background:url("cid:\");EVIL_CSS_HERE;background:url(\"cid:")'>
```

Would erroneously "sanitize" to:

```html
<div style='background:url("cid:");EVIL_CSS_HERE;background:url("cid:")'>
```

---

This vulnerability was reported by Uttej Badwane

(As written by RustSec Advisory Database.)

## Affected

- ammonia (crates.io): from 0.0.0-0 before 4.1.7; from 4.2.0 before 4.2.3

## References

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

## Sources

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

---

Page: https://cve.day/GHSA-69v2-w9vg-4g83 · Whole record: https://cve.day/GHSA-69v2-w9vg-4g83.json · Rebuilt by cve.day 2026-11-25T22:56:43.088Z
