{"id":"GHSA-v363-rrf2-5fmj","aliases":["GHSA-v363-rrf2-5fmj","RUSTSEC-2024-0001"],"related":[],"kind":"vulnerability","state":"published","title":"ferris-says has undefined behavior when not using UTF-8","summary":"Affected versions receive a `&[u8]` from the caller through a safe API, and pass it directly to the unsafe `str::from_utf8_unchecked` function.\n\nThe behavior of `ferris_says::say` is undefined if the bytes from the caller don't happen to be valid UTF-8.\n\nThe 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.\n\nSeparately, [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.\n\n[ferris-says#21]: https://github.com/rust-lang/ferris-says/pull/21\n[ferris-says#32]: https://github.com/rust-lang/ferris-says/pull/32","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"Affected versions receive a `&[u8]` from the caller through a safe API, and pass it directly to the unsafe `str::from_utf8_unchecked` function.\n\nThe behavior of `ferris_says::say` is undefined if the bytes from the caller don't happen to be valid UTF-8.\n\nThe 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.\n\nSeparately, [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.\n\n[ferris-says#21]: https://github.com/rust-lang/ferris-says/pull/21\n[ferris-says#32]: https://github.com/rust-lang/ferris-says/pull/32","format":"markdown","source":"ghsa"}],"published":"2024-01-13T12:00:00.000Z","modified":"2024-02-10T16:26:48.909Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"LOW"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"LOW"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.1.2","status":"affected","lastAffected":"0.2.1"}],"ecosystem":"crates.io","package":"ferris-says","purl":"pkg:cargo/ferris-says","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.3.0","status":"affected","fixed":"0.3.1"}],"ecosystem":"crates.io","package":"ferris-says","purl":"pkg:cargo/ferris-says","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.1.3-0","status":"affected","fixed":"0.3.1"}],"ecosystem":"crates.io","package":"ferris-says","purl":"pkg:cargo/ferris-says","source":"rustsec"}],"references":[{"url":"https://github.com/rust-lang/ferris-says/pull/21","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/rust-lang/ferris-says/commit/bb661f29e0d88968c495a4ea4dc63ff0e2c2c11a","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/mgattozzi/ferris-says","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2024-0001.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/ferris-says","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-v363-rrf2-5fmj","url":"https://github.com/advisories/GHSA-v363-rrf2-5fmj","licence":"CC-BY-4.0","modified":"2024-02-10T16:26:48.909Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2024-0001","url":"https://rustsec.org/advisories/RUSTSEC-2024-0001.html","licence":"CC0-1.0","modified":"2024-02-10T16:26:48.909Z"}],"updatedAt":"2026-11-25T22:56:43.181Z"}