libcrux: Potential Panic on Overlong Ciphertext Buffer

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.

Basic information

Type
reviewed
Severity
high
Advisory on GitHub
Open advisory ↗
Repository advisory
Source code
Browse source ↗
Published (advisory)
2026-05-19 16:18:33 UTC
Updated
2026-05-19 16:18:36 UTC
GitHub reviewed
2026-05-19 16:18:33 UTC

CVSS Scores

Base score Version Severity Vector
8.2 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 Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network.
Attack complexity (AC:L)
Exploitation conditions are straightforward and stable.
Attack requirements (AT:P)
Additional preconditions must be present for exploitation.
Privileges required (PR:N)
No privileges are required.
User interaction (UI:N)
No user interaction is required.
Vulnerable system confidentiality impact (VC:N)
No confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:N)
No integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:H)
High availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:N)
No confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:N)
No integrity impact on subsequent systems.
Subsequent system availability impact (SA:N)
No availability impact on subsequent systems.

Identifiers

Type Value
GHSA GHSA-hc3c-63hc-2r9f ↗

CWEs

CWE id Name
CWE-120 Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
rust libcrux-chacha20poly1305 < 0.0.8 0.0.8

References

cvelogic Threat Intelligence