GHSA-fq33-vmhv-48xh ntru-rs has unsound FFI: Wrong API usage causes write past allocated area
Incorrect API usage in ntru-rs causes memory corruption, potentially leading to code execution or crashes.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Not stated
- Victim action needed
- Not needed
- Fix
- None listed
What is GHSA-fq33-vmhv-48xh?
GHSA-fq33-vmhv-48xh is a memory corruption vulnerability in ntru, published on 22 Mar 2023.
Official 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.
Which versions are affected by GHSA-fq33-vmhv-48xh?
3 open source packages ship an affected version, including ntru.
| Package | Affected | Fixed in |
|---|---|---|
ntru crates.io | From 0.0.0-0 | None |
ntru crates.io | From 0.4.3 to 0.5.6 | None |
ntru crates.io | From 0.4.3 to 0.5.6 | None |
How do I fix GHSA-fq33-vmhv-48xh?
No fix has been published for GHSA-fq33-vmhv-48xh yet. Limit exposure of the affected software until one is available.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is GHSA-fq33-vmhv-48xh being exploited?
There is no known exploitation of GHSA-fq33-vmhv-48xh in the wild and no public exploit code.
Sources
Also known as RUSTSEC-2023-0032.