Unsoundness in anstream
Historical advisory saved 24 Oct 2026 13:19:54 UTC. The publisher may have updated it since then. Latest advisory.
osv · RUSTSEC-2024-0404
PublishedWhen 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. When looping over "non-printable bytes" \x1b\xf0 will be considered as some non-printable sequence. This will produce a broken str from the incorrectly segmented bytes via str::from_utf8_unchecked, and that should never happen. Full credit goes to [@Ralith](https://github.com/Ralith) who reviewed this code and asked [@burakemir](https://github.com/burakemir) to follow up.
- Source published
- 8 Sep 2024 12:00:00 UTC
- Source modified
- 17 Jul 2026 16:00:04 UTC
- Saved here
- 24 Oct 2026 13:19:54 UTC
- Source terms
- OSV · upstream source license applies
Original source record · Cite this exact observation · Complete original publisher JSON
Source: osv · OSV · upstream source license applies. The publisher's wording is preserved. ChangeIntel groups the information and labels changes. The JSON record includes additional source fields.