RUSTSEC-2024-0001
LOWferris-says has undefined behavior when not using UTF-8
Affected versions receive a &[u8] from the caller through a safe API, and pass it directly to the unsafe str::from_utf8_unchecked function.
The behavior of ferris_says::say is undefined if the bytes from the caller don't happen to be valid UTF-8.
The flaw was corrected in ferris-says#21 by using the safe str::from_utf8 instead, and returning an error on invalid input. However this fix has not yet been published to crates.io as a patch version for 0.2.
Separately, ferris-says#32 has introduced a different API for version 0.3 which accepts input as &str rather than &[u8], so is unaffected by this bug.
- Published
- 13 Jan 2024
- Last modified
- 10 Feb 2024
- Also known as
- GHSA-v363-rrf2-5fmj
- Sources
- OSV GHSA-v363-rrf2-5fmjJSONOSVJSON
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | ferris-says | >= 0.1.2, <= 0.2.1 | |
| OSV | crates.io | ferris-says | >= 0.3.0, < 0.3.1 | 0.3.1 |
| OSV | crates.io | ferris-says | >= 0.1.3-0, < 0.3.1 | 0.3.1 |
References
- https://github.com/rust-lang/ferris-says/pull/21 · WEB
- https://github.com/rust-lang/ferris-says/commit/bb661f29e0d88968c495a4ea4dc63ff0e2c2c11a · WEB
- https://github.com/mgattozzi/ferris-says · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2024-0001.html · WEB, ADVISORY
- https://crates.io/crates/ferris-says · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 13 Jan 2024)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 17 Jan 2024)