RUSTSEC-2023-0032
MEDIUMntru-rs has unsound FFI: Wrong API usage causes write past allocated area
The following usage causes undefined behavior.
let kp: ntru::types::KeyPair = …;
kp.get_public().export(Default::default())
When compiled with debug assertions, the code above will trigger a attempt to subtract with overflow panic before UB occurs.
Other mistakes (e.g. using EncParams from a different key) may always trigger UB.
Likely, older versions of this crate are also affected, but have not been tested.
- Published
- 22 Mar 2023
- Last modified
- 8 Nov 2023
- Also known as
- GHSA-fq33-vmhv-48xh
- Sources
- OSV GHSA-fq33-vmhv-48xhJSONOSVJSON
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | crates.io | ntru | >= 0.4.3, <= 0.5.6 | |
| OSV | crates.io | ntru | >= 0.0.0-0 |
References
- https://github.com/FrinkGlobal/ntru-rs/issues/8 · WEB, REPORT
- https://github.com/FrinkGlobal/ntru-rs · PACKAGE
- https://rustsec.org/advisories/RUSTSEC-2023-0032.html · WEB, ADVISORY
- https://crates.io/crates/ntru · PACKAGE
History
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 22 Mar 2023)
- 25 Nov 2026 20:14 UTC · OSV: first stored (published 7 Apr 2023)