{"id":"GHSA-p2g9-94wh-65c2","aliases":["RUSTSEC-2022-0003"],"status":"published","title":"Space bug in `clean_text`","description":"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!(\"\u003cdiv title={}\u003e\", 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.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2022-01-19T12:00:00Z","modified":"2023-11-08T04:21:23Z","fixes":[{"ecosystem":"crates.io","package":"ammonia","fixed_in":["3.1.3"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"crates.io","package":"ammonia","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.1.3"}]}]},{"source":"osv","ecosystem":"crates.io","package":"ammonia","ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"3.1.3"}]}]},{"source":"osv","ecosystem":"crates.io","package":"ammonia","ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"3.1.3"}]}]}],"references":[{"url":"https://github.com/rust-ammonia/ammonia/pull/147","tags":["web"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2022-0003.html","tags":["web","advisory"]},{"url":"https://github.com/rust-ammonia/ammonia/commit/6c7bf22907a75d1bbaed52e4f7dd9716f5e6f737","tags":["web"]},{"url":"https://github.com/advisories/GHSA-p2g9-94wh-65c2"},{"url":"https://github.com/rust-ammonia/ammonia","tags":["package"]},{"url":"https://crates.io/crates/ammonia","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-p2g9-94wh-65c2","title":"Space bug in `clean_text`","description":"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!(\"\u003cdiv title={}\u003e\", 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.\n","status":"published","published":"2022-06-16T23:39:55Z","modified":"2023-04-13T22:10:14Z","cwes":["CWE-79"],"updated_at":"2026-11-02T14:36:50.476488Z"}],"osv":[{"id":"GHSA-p2g9-94wh-65c2","title":"Space bug in `clean_text`","description":"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!(\"\u003cdiv title={}\u003e\", 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.\n","status":"published","published":"2022-06-16T23:39:55Z","modified":"2023-11-08T04:21:23.389784Z","cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:52.534897Z"},{"id":"RUSTSEC-2022-0003","title":"Space bug in `clean_text`","description":"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!(\"\u003cdiv title={}\u003e\", 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.","status":"published","published":"2022-01-19T12:00:00Z","modified":"2023-11-08T04:21:23.389784Z","updated_at":"2026-11-02T15:53:39.971022Z"}]}}
