xxhash-rust: Safe xxh3 custom-secret API accepts too-short secret in releaseGHSA-6g2r-675j-hx59
LOWFix: DoumanAsh/xxhash-rust@200cadbGHSA-6g2r-675j-hx59 is a low-severity (CVSS 2.3) vulnerability in xxhash-rust. A fix is available for xxhash-rust — see the affected versions and patch details below.
Real-World Exposure
xxhash-rustReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | xxhash-rust | all versions | 0.8.16cargo update -p xxhash-rust --precise 0.8.16 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for xxhash-rust, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update xxhash-rust to 0.8.16 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-6g2r-675j-hx59 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is GHSA-6g2r-675j-hx59 in your dependencies?
Find it across crates.io, including transitive dependencies.