# GHSA-q29p-9pfr-j652: Incorrect Output of Incremental Portable SHAKE API

> Incorrect output generation in the SHAKE XOF API when squeezing large amounts of data, potentially leading to invalid cryptographic results.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Mar 2026
- **Also known as:** RUSTSEC-2026-0074

## What is GHSA-q29p-9pfr-j652?

GHSA-q29p-9pfr-j652 is a vulnerability in libcrux-sha3, published on 4 Mar 2026. 

### Official description

The incremental squeeze functions in the portable SHAKE XOF API, when
 attempting to squeeze more than `RATE` (168 for SHAKE128, 136 for
 SHAKE256) bytes, performed an additional permutation of the state
 before producing the first output block, thus discarding the first
 block of `RATE` bytes of valid XOF output.

## Impact
This bug impacts users that rely on this XOF API to squeeze more than
`RATE` bytes. It does not impact the use of libcrux-sha3 in
libcrux-ml-kem or libcrux-ml-dsa.

## Mitigation
Starting from version `0.0.8` the squeeze functions correctly output
all blocks including the first block.

## Which versions are affected by GHSA-q29p-9pfr-j652?

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


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

## How do I fix GHSA-q29p-9pfr-j652?

Upgrade libcrux-sha3 to 0.0.8 or later.

## Is GHSA-q29p-9pfr-j652 being exploited?

There is no known exploitation of GHSA-q29p-9pfr-j652 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-q29p-9pfr-j652 and fix it if it is affected.

What it is: GHSA-q29p-9pfr-j652 is a vulnerability in libcrux-sha3, published on 4 Mar 2026. 
Exploitation: There is no known exploitation of GHSA-q29p-9pfr-j652 in the wild and no public exploit code.

Affected packages and fixed versions:
- libcrux-sha3 (crates.io): affected all versions; fixed in 0.0.8
- libcrux-sha3 (crates.io): affected all versions; fixed in 0.0.8
- libcrux-sha3 (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-q29p-9pfr-j652/ (Markdown: https://insights.sbomify.com/GHSA-q29p-9pfr-j652/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-q29p-9pfr-j652

---
From sbomify Insights: https://insights.sbomify.com/GHSA-q29p-9pfr-j652/
Summaries are generated and may contain mistakes; the official description above is the record.
