Skip to content
Fencer Intel
no cvss —

GHSA-69v2-w9vg-4g83 json

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

published 5y ago modified 30d ago also RUSTSEC-2021-0157

cvss
—
not scored
cisa kev
Not listed
not in CISA's catalog
epss
—
no score, EPSS covers CVEs only
public exploits
0
none known

Summary

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

Patch / fix

  • crates.io ammonia 4.1.7, 4.2.3

Is GHSA-69v2-w9vg-4g83 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Affected packages

ecosystem package affected fixed in
crates.io ammonia
>=0.0.0-0, <4.1.7
>=4.2.0, <4.2.3
4.1.7
4.2.3

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.