RUSTSEC-2022-0003
MEDIUMSpace bug in `clean_text`
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.
- Published
- 19 Jan 2022
- Last modified
- 8 Nov 2023
- Weakness
- CWE-79
- Also known as
- GHSA-p2g9-94wh-65c2
- Sources
- OSV GHSA-p2g9-94wh-65c2JSONOSVJSON
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | ammonia | >= 3.0.0, < 3.1.3 | 3.1.3 |
References
- https://github.com/rust-ammonia/ammonia/pull/147 · WEB
- https://github.com/rust-ammonia/ammonia/commit/6c7bf22907a75d1bbaed52e4f7dd9716f5e6f737 · WEB
- https://github.com/rust-ammonia/ammonia · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2022-0003.html · WEB, ADVISORY
- https://crates.io/crates/ammonia · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 19 Jan 2022)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 16 Jun 2022)