Rust advisories / hpke-rs-rust-crypto
Vulnerability HighRUSTSEC-2026-0072 · hpke-rs-rust-crypto
RUSTSEC-2026-0072: Missing Check for All-Zero X25519 Shared Secret
Short answerA security vulnerability in the hpke-rs-rust-crypto crate: Missing Check for All-Zero X25519 Shared Secret. GitHub rates it High. Fixed in 0.6.0: update to a fixed version.
| Crate | hpke-rs-rust-crypto |
|---|---|
| Type | Vulnerability |
| Affected versions | Before 0.6.0. |
| Fixed in | 0.6.0 |
| Severity | High (GitHub rating) |
| Published | 2026-02-04 |
| Last changed | 2026-03-24 |
| Also known as | GHSA-g433-pq76-6cmf, RUSTSEC-2026-0069, RUSTSEC-2026-0070, RUSTSEC-2026-0071 |
| Affected functions | hpke_rs_rust_crypto::HpkeRustCrypto::dh |
What to do
- See which version you have:
cargo tree -i hpke-rs-rust-crypto(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p hpke-rs-rust-crypto. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplehpke-rs-rust-crypto = "0.6.0") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
Computing an X25519 shared secret with x25519_dalek::StaticSecret::diffie_hellman does not include the check that the key exchange was contributory, i.e. does not ensure on its own that the resulting shared secret is non-zero.
Impact
RFC 9180 mandates that implementations of HPKE must check for all zero Diffie-Hellman shared secrets and abort if so.
Applications using hpke-rs with the RustCryto provider would not perform this check allowing for non-contributive Diffie-Hellman shared secrets. Applications using hpke-rs with the libcrux provider are not affected.
Mitigation
Starting with version 0.6.0, an error will be returned when the computed Diffie-Hellman shared secret is all-zero.
References
- Package: crates.io/crates/hpke-rs-rust-crypto
- Advisory: rustsec.org/advisories/RUSTSEC-2026-0072.html
- Web: github.com/cryspen/hpke-rs/pull/124
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Up next
Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →Also worth your time
Did this answer your question?