GHSA-p2g9-94wh-65c2 json
Space bug in `clean_text`
published 4y ago modified 3y ago also RUSTSEC-2022-0003
- 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
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.
Patch / fix
- crates.io ammonia 3.1.3
- github.com/rust-ammonia/ammonia@6c7bf22 commit
- github.com/rust-ammonia/ammonia#147 pull request
Is GHSA-p2g9-94wh-65c2 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 FencerAffected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| crates.io | ammonia | >=3.0.0, <3.1.3 |
3.1.3 |
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
References
Sources
- GitHub Advisory GHSA-p2g9-94wh-65c2
- OSV RUSTSEC-2022-0003
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.