GitHub Advisoryadvisory · crates.io

GHSA-hc3c-63hc-2r9f libcrux: Potential Panic on Overlong Ciphertext Buffer

HIGH Published 2026-05-19 Modified 2026-05-19 Official page ↗
Ecosystem
crates.io
Packages
libcrux-chacha20poly1305
Severity
High
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weaknesses
CWE-120
Reviewed
2026-05-19

Affected packages

• crates.io libcrux-chacha20poly1305: < 0.0.8 → fixed in 0.0.8

Description

An application that passes in a ciphertext buffer of length greater than `ptxt.len() + TAG_LEN` to `libcrux_chacha20poly1305::encrypt` or `libcrux_chacha20poly1305::xchacha20_poly1305::encrypt` would experience a panic. Impact An application where the length of the ciphertext buffer is under attacker control could be made to crash. Mitigation The fix makes it so that `libcrux_chacha20poly1305::encrypt` and `libcrux_chacha20poly1305::xchacha20_poly1305::encrypt` no longer panic in this case, but instead write out the ciphertext and tag into the first `ptxt.len() + TAG_LEN` bytes of the provided buffer.

Related

Weakness · CWE (1)

  • CWE-120 Buffer Copy without Checking Size of Input weakness

References