Security mailing lists by PureSourceCode

RUSTSEC-2023-0032

MEDIUM

ntru-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

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV crates.io ntru >= 0.4.3, <= 0.5.6
OSV crates.io ntru >= 0.0.0-0

References

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)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.