{"id":"GHSA-fq33-vmhv-48xh","aliases":["GHSA-fq33-vmhv-48xh","RUSTSEC-2023-0032"],"related":[],"kind":"vulnerability","state":"published","title":"ntru-rs has unsound FFI: Wrong API usage causes write past allocated area","summary":"The following usage causes undefined behavior.\n```rust\nlet kp: ntru::types::KeyPair = …;\nkp.get_public().export(Default::default())\n```\n\nWhen compiled with debug assertions, the code above will trigger a `attempt to subtract with overflow` panic before UB occurs.\nOther mistakes (e.g. using `EncParams` from a different key) may always trigger UB.\n\nLikely, older versions of this crate are also affected, but have not been tested.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"The following usage causes undefined behavior.\n```rust\nlet kp: ntru::types::KeyPair = …;\nkp.get_public().export(Default::default())\n```\n\nWhen compiled with debug assertions, the code above will trigger a `attempt to subtract with overflow` panic before UB occurs.\nOther mistakes (e.g. using `EncParams` from a different key) may always trigger UB.\n\nLikely, older versions of this crate are also affected, but have not been tested.","format":"markdown","source":"ghsa"}],"published":"2023-03-22T12:00:00.000Z","modified":"2023-11-08T04:19:06.327Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"MEDIUM"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0.4.3","status":"affected","lastAffected":"0.5.6"}],"ecosystem":"crates.io","package":"ntru","purl":"pkg:cargo/ntru","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected"}],"ecosystem":"crates.io","package":"ntru","purl":"pkg:cargo/ntru","source":"rustsec"}],"references":[{"url":"https://github.com/FrinkGlobal/ntru-rs/issues/8","tags":["report","web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/FrinkGlobal/ntru-rs","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2023-0032.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/ntru","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fq33-vmhv-48xh","url":"https://github.com/advisories/GHSA-fq33-vmhv-48xh","licence":"CC-BY-4.0","modified":"2023-11-08T04:19:06.327Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2023-0032","url":"https://rustsec.org/advisories/RUSTSEC-2023-0032.html","licence":"CC0-1.0","modified":"2023-11-08T04:19:06.327Z"}],"updatedAt":"2026-11-25T22:56:43.146Z"}