{"id":"GHSA-p2g9-94wh-65c2","aliases":["GHSA-p2g9-94wh-65c2","RUSTSEC-2022-0003"],"related":[],"kind":"vulnerability","state":"published","title":"Space bug in `clean_text`","summary":"An incorrect mapping from HTML specification to ASCII codes was used.\nBecause HTML treats the Form Feed as whitespace, code like this has an injection bug:\n\n    let html = format!(\"<div title={}>\", clean_text(user_supplied_string));\n\nApplications are not affected if they quote their attributes, or if they don't use `clean_text` at all.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"An incorrect mapping from HTML specification to ASCII codes was used.\nBecause HTML treats the Form Feed as whitespace, code like this has an injection bug:\n\n    let html = format!(\"<div title={}>\", clean_text(user_supplied_string));\n\nApplications are not affected if they quote their attributes, or if they don't use `clean_text` at all.","format":"markdown","source":"ghsa"}],"published":"2022-01-19T12:00:00.000Z","modified":"2023-11-08T04:21:23.389Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"semver","introduced":"3.0.0","status":"affected","fixed":"3.1.3"}],"ecosystem":"crates.io","package":"ammonia","purl":"pkg:cargo/ammonia","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"3.0.0","status":"affected","fixed":"3.1.3"}],"ecosystem":"crates.io","package":"ammonia","purl":"pkg:cargo/ammonia","source":"rustsec"}],"references":[{"url":"https://github.com/rust-ammonia/ammonia/pull/147","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/rust-ammonia/ammonia/commit/6c7bf22907a75d1bbaed52e4f7dd9716f5e6f737","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rust-ammonia/ammonia","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2022-0003.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/ammonia","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p2g9-94wh-65c2","url":"https://github.com/advisories/GHSA-p2g9-94wh-65c2","licence":"CC-BY-4.0","modified":"2023-11-08T04:21:23.389Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2022-0003","url":"https://rustsec.org/advisories/RUSTSEC-2022-0003.html","licence":"CC0-1.0","modified":"2023-11-08T04:21:23.389Z"}],"updatedAt":"2026-11-25T22:56:43.089Z"}