Advisory

RUSTSEC-2023-0032

Also known as: GHSA-fq33-vmhv-48xh

Summary

Unsound FFI: Wrong API usage causes write past allocated area

Details

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.

Severity

Not rated by the source.

Dates

Published
2023-03-22 12:00 UTC
Modified
2023-11-08 04:19 UTC

Affected packages and fixes

ntru

crates.io · All systems

Affected

  • introduced 0.0.0-0 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences