# GHSA-HC3C-63HC-2R9F: libcrux: Potential Panic on Overlong Ciphertext Buffer

- Database: GitHub
- Severity: high (stated by ghsa, no CVSS score)
- Published: 2026-05-19
- Modified: 2026-05-20

## Also published as

- [RUSTSEC-2026-0124](https://cve.now/RUSTSEC-2026-0124.md) (RustSec)

## Affected versions

- libcrux-chacha20poly1305 (crates.io): 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.

## References

- https://github.com/cryspen/libcrux/pull/1386
- https://github.com/cryspen/libcrux
- https://rustsec.org/advisories/RUSTSEC-2026-0124.html

Page: https://cve.now/GHSA-HC3C-63HC-2R9F

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
