{"id":"GHSA-2rxc-gjrp-vjhx","aliases":["GHSA-2rxc-gjrp-vjhx","RUSTSEC-2024-0404"],"related":[],"kind":"vulnerability","state":"published","title":"Unsoundness in anstream","summary":"When given a valid UTF8 string \"ö\\x1b😀\", the function in crates/anstream/src/adapter/strip.rs will be confused. The UTF8 bytes are \\xc3\\xb6 then \\x1b then \\xf0\\x9f\\x98\\x80.\n\nWhen looping over \"non-printable bytes\" \\x1b\\xf0 will be considered as some non-printable sequence.\n\nThis will produce a broken str from the incorrectly segmented bytes via str::from_utf8_unchecked, and that should never happen.\n\nFull credit goes to @Ralith who reviewed this code and asked @burakemir to follow up.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"When given a valid UTF8 string \"ö\\x1b😀\", the function in crates/anstream/src/adapter/strip.rs will be confused. The UTF8 bytes are \\xc3\\xb6 then \\x1b then \\xf0\\x9f\\x98\\x80.\n\nWhen looping over \"non-printable bytes\" \\x1b\\xf0 will be considered as some non-printable sequence.\n\nThis will produce a broken str from the incorrectly segmented bytes via str::from_utf8_unchecked, and that should never happen.\n\nFull credit goes to @Ralith who reviewed this code and asked @burakemir to follow up.","format":"markdown","source":"ghsa"},{"lang":"en","text":"When given a valid UTF8 string \"ö\\x1b😀\", the function in\ncrates/anstream/src/adapter/strip.rs will be confused. The UTF8\nbytes are \\xc3\\xb6 then \\x1b then \\xf0\\x9f\\x98\\x80.\n\nWhen looping over \"non-printable bytes\" \\x1b\\xf0 will be\nconsidered as some non-printable sequence.\n\nThis will produce a broken str from the incorrectly segmented\nbytes via str::from_utf8_unchecked, and that should never happen.\n\nFull credit goes to [@Ralith](https://github.com/Ralith) who reviewed this code and\nasked [@burakemir](https://github.com/burakemir) to follow up.","format":"markdown","source":"rustsec"}],"published":"2024-09-08T12:00:00.000Z","modified":"2026-09-10T03:50:21.162Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.6.8"}],"ecosystem":"crates.io","package":"anstream","purl":"pkg:cargo/anstream","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.6.8"}],"ecosystem":"crates.io","package":"anstream","purl":"pkg:cargo/anstream","source":"rustsec"}],"references":[{"url":"https://github.com/rust-cli/anstyle/issues/156","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/rust-cli/anstyle","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2024-0404.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/anstream","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2rxc-gjrp-vjhx","url":"https://github.com/advisories/GHSA-2rxc-gjrp-vjhx","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:21.162Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2024-0404","url":"https://rustsec.org/advisories/RUSTSEC-2024-0404.html","licence":"CC0-1.0","modified":"2026-07-17T16:00:04.561Z"}],"updatedAt":"2026-11-25T22:56:43.225Z"}