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

- Severity: High (CVSS:4.0, scored by GitHub) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-03-29T12:00:00.000Z
- Modified: 2026-05-20T07:26:23.649Z
- Also known as: RUSTSEC-2026-0124
- Weaknesses: CWE-120

## 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.

(As written by GitHub Advisory Database.)

## Affected

- libcrux-chacha20poly1305 (crates.io): before 0.0.8; from 0.0.0-0 before 0.0.8

## Every score

- GitHub: CVSS:4.0 High `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`
- RustSec Advisory Database: CVSS:4.0 `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`

## References

- <https://github.com/cryspen/libcrux/pull/1386> (web)
- <https://github.com/cryspen/libcrux> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0124.html> (advisory, web)
- <https://crates.io/crates/libcrux-chacha20poly1305> (package)

## Sources

- GitHub Advisory Database: [GHSA-hc3c-63hc-2r9f](https://github.com/advisories/GHSA-hc3c-63hc-2r9f), CC-BY-4.0, modified 2026-05-20
- RustSec Advisory Database: [RUSTSEC-2026-0124](https://rustsec.org/advisories/RUSTSEC-2026-0124.html), CC0-1.0, modified 2026-05-20

---

Page: https://cve.day/GHSA-hc3c-63hc-2r9f · Whole record: https://cve.day/GHSA-hc3c-63hc-2r9f.json · Rebuilt by cve.day 2026-11-25T22:56:43.347Z
