GHSA-v363-rrf2-5fmj
low
ferris-says has undefined behavior when not using UTF-8
- Severity
- low rating by GitHub
- Published
- Last changed
- Also known as
- RUSTSEC-2024-0001
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| ferris-says (crates.io) | from 0.1.2 up to 0.2.1, from 0.3.0 before 0.3.1, from 0.1.3-0 before 0.3.1 | GitHub Advisory Database, RustSec Advisory Database |
References
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-v363-rrf2-5fmj changed 2024-02-10 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2024-0001 changed 2024-02-10 | CC0-1.0 |