What’s Vulnerable › Vulnerabilities
RUSTSEC-2022-0003: Space bug in `clean_text`
- Severity: unknown
- Exploited in the wild: not listed in CISA KEV
- Public exploit or detection template: none known
- Published: 2022-01-19 · updated 2023-11-08
Description
An incorrect mapping from HTML specification to ASCII codes was used. Because HTML treats the Form Feed as whitespace, code like this has an injection bug: let html = format!("<div title={}>", clean_text(user_supplied_string)); Applications are not affected if they quote their attributes, or if they don't use `clean_text` at all.
Affected products
- Crates.Io Ammonia: from 3.0.0 before 3.1.3 — fixed in 3.1.3
How to fix
Upgrade to a fixed version: Crates.Io Ammonia 3.1.3. Check the vendor advisory for mitigations.
References
- https://crates.io/crates/ammonia
- https://rustsec.org/advisories/RUSTSEC-2022-0003.html
- https://github.com/rust-ammonia/ammonia/pull/147
Get alerted when RUSTSEC-2022-0003 or the next vulnerability affects your stack