Security mailing lists by PureSourceCode

RUSTSEC-2021-0157

not scored yet

Incorrect escaping for `url("")` functions in CSS style attributes

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

Published
10 Oct 2021
Last modified
12 Oct 2026
Also known as
GHSA-69v2-w9vg-4g83
Sources
OSVJSON

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV crates.io ammonia >= 0.0.0-0, < 4.1.7; >= 4.2.0, < 4.2.3 4.1.7, 4.2.3

References

History

  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 10 Oct 2021)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.