RUSTSEC-2024-0404
MEDIUMUnsoundness in anstream
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.
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 who reviewed this code and asked @burakemir to follow up.
- Published
- 8 Sep 2024
- Last modified
- 10 Sep 2026
- Also known as
- GHSA-2rxc-gjrp-vjhx
- Sources
- OSV GHSA-2rxc-gjrp-vjhxJSONOSVJSON
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | anstream | < 0.6.8 | 0.6.8 |
| OSV | crates.io | anstream | >= 0.0.0-0, < 0.6.8 | 0.6.8 |
References
- https://github.com/rust-cli/anstyle/issues/156 路 WEB, REPORT
- https://github.com/rust-cli/anstyle 路 PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2024-0404.html 路 WEB, ADVISORY
- https://crates.io/crates/anstream 路 PACKAGE
History
- 25 Nov 2026 20:14 UTC 路 OSV: first stored (published 8 Sep 2024)
- 25 Nov 2026 20:14 UTC 路 OSV: first stored (published 4 Dec 2024)