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

> An attacker can cause a denial of service by providing an overlong ciphertext buffer to the libcrux encryption functions, crashing the application.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 29 Mar 2026
- **Also known as:** RUSTSEC-2026-0124

## What is GHSA-hc3c-63hc-2r9f?

GHSA-hc3c-63hc-2r9f is a denial of service vulnerability in libcrux-chacha20poly1305, published on 29 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

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

## Which versions are affected by GHSA-hc3c-63hc-2r9f?

3 open source packages ship an affected version, including libcrux-chacha20poly1305.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libcrux-chacha20poly1305` | crates.io | All versions | 0.0.8 |
| `libcrux-chacha20poly1305` | crates.io | All versions | 0.0.8 |
| `libcrux-chacha20poly1305` | crates.io | From 0.0.0-0 | 0.0.8 |

## How do I fix GHSA-hc3c-63hc-2r9f?

Upgrade libcrux-chacha20poly1305 to 0.0.8 or later.

## Is GHSA-hc3c-63hc-2r9f being exploited?

There is no known exploitation of GHSA-hc3c-63hc-2r9f in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-hc3c-63hc-2r9f and fix it if it is affected.

What it is: GHSA-hc3c-63hc-2r9f is a denial of service vulnerability in libcrux-chacha20poly1305, published on 29 Mar 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-hc3c-63hc-2r9f in the wild and no public exploit code.

Affected packages and fixed versions:
- libcrux-chacha20poly1305 (crates.io): affected all versions; fixed in 0.0.8
- libcrux-chacha20poly1305 (crates.io): affected all versions; fixed in 0.0.8
- libcrux-chacha20poly1305 (crates.io): affected from 0.0.0-0; fixed in 0.0.8

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-hc3c-63hc-2r9f/ (Markdown: https://insights.sbomify.com/GHSA-hc3c-63hc-2r9f/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-hc3c-63hc-2r9f

---
From sbomify Insights: https://insights.sbomify.com/GHSA-hc3c-63hc-2r9f/
Summaries are generated and may contain mistakes; the official description above is the record.
