GHSA-fq33-vmhv-48xh ntru-rs has unsound FFI: Wrong API usage causes write past allocated area
Unknown
- Published
- Updated
- Exploit status
- No public exploit known
Description
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.
Upgrade path
1 package: 0 fixed, 1 partially fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| crates.io ntru(crates.io) | >= 0.0.0-0; >= 0.4.3, <= 0.5.6 | after 0.5.6 | Partially fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| crates.io ntru(crates.io) | >= 0.4.3, <= 0.5.6 | No fix listed |
| crates.io ntru(crates.io) | >= 0.0.0-0 | No fix listed |
References
- github.com issue-tracking
- rustsec.org vendor-advisory
- github.com
- github.com product
- crates.io product