# GHSA-6g2r-675j-hx59: xxhash-rust: Safe xxh3 custom-secret API accepts too-short secret in release

> A safe API in xxhash-rust accepts short secrets, causing undefined behavior and potential crashes or code execution in release builds.

- **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:** 2 Oct 2026

## What is GHSA-6g2r-675j-hx59?

GHSA-6g2r-675j-hx59 is a memory corruption vulnerability in xxhash-rust, published on 2 Oct 2026. 

### Official description

I have a minimized safe Rust witness for xxhash-rust 0.8.15.

Safe public route:

xxhash_rust::xxh3::xxh3_64_with_secret(&[0x41], &[])

The caller-side harness contains no unsafe code. Under release execution, the internal minimum custom-secret length predicate is enforced only by debug_assert!. Release-Miri reports construction of a fixed-width reference beyond the empty secret allocation.

Observed diagnostic:

Undefined Behavior: constructing invalid value of type &[u8; 4]: encountered a dangling reference

Local repair evidence: handling custom-secret slices shorter than the internal minimum before fixed-width secret reads makes the same safe short-secret harness pass under Linux release-Miri.

Local artifacts:
- vulnerable log: artifacts/logs/W-4332_xxhash_rust_short_secret_miri_release_linux_001.log
- repair log: artifacts/logs/differentials/W-4332_xxhash_rust_local_repair_miri_release_linux_001.log
- report: artifacts/reports/W-4332_xxhash_rust_short_secret_report.md

## Which versions are affected by GHSA-6g2r-675j-hx59?

2 open source packages ship an affected version, including xxhash-rust.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `xxhash-rust` | crates.io | All versions | 0.8.16 |
| `xxhash-rust` | crates.io | All versions | 0.8.16 |

## How do I fix GHSA-6g2r-675j-hx59?

Upgrade xxhash-rust to 0.8.16 or later.

## Is GHSA-6g2r-675j-hx59 being exploited?

There is no known exploitation of GHSA-6g2r-675j-hx59 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-6g2r-675j-hx59 and fix it if it is affected.

What it is: GHSA-6g2r-675j-hx59 is a memory corruption vulnerability in xxhash-rust, published on 2 Oct 2026. 
Exploitation: There is no known exploitation of GHSA-6g2r-675j-hx59 in the wild and no public exploit code.

Affected packages and fixed versions:
- xxhash-rust (crates.io): affected all versions; fixed in 0.8.16
- xxhash-rust (crates.io): affected all versions; fixed in 0.8.16

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-6g2r-675j-hx59/ (Markdown: https://insights.sbomify.com/GHSA-6g2r-675j-hx59/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-6g2r-675j-hx59

---
From sbomify Insights: https://insights.sbomify.com/GHSA-6g2r-675j-hx59/
Summaries are generated and may contain mistakes; the official description above is the record.
