# GHSA-g433-pq76-6cmf: Bug fixes in hpke-rs, hpke-rs-rust-crypto

> Fixes integer overflow in context counters and incorrect algorithm mapping in hpke-rs, potentially leading to cryptographic bypasses or errors.

- **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:** 4 Feb 2026
- **Also known as:** RUSTSEC-2026-0069, RUSTSEC-2026-0070, RUSTSEC-2026-0071, RUSTSEC-2026-0072

## What is GHSA-g433-pq76-6cmf?

GHSA-g433-pq76-6cmf is a vulnerability in hpke-rs, published on 4 Feb 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

We publish a GitHub security advisory for any releases whose CHANGELOG includes bug-fixes, and encourage our users to upgrade. The latest releases of the hpke-rs and hpke-rs-rust-crypto crates contain the following bug-fixes:

## hpke-rs
- [#127](https://github.com/cryspen/hpke-rs/pull/127): Fix `KemAlgorithm::TryFrom<u16>` mapping where `0x004D` incorrectly resolved to `XWingDraft06` instead of `XWingDraft06Obsolete`.
- [#123](https://github.com/cryspen/hpke-rs/pull/123): Fix potential overflow in context counter and switch to use u64.
- [#128](https://github.com/cryspen/hpke-rs/pull/128): Return errors when trying to use open/seal with export only ciphersuite and when using kdf export with an output that's too long (instead of truncating it)

The issue fixed in #123 was first reported by Nadim Kobeissi.
The issues fixed in #127 and #128 were first reported by Scott Arciszewski.

## hpke-rs-rust-crypto
- [#124](https://github.com/cryspen/hpke-rs/pull/124): Error out on x25519 0 keys

The issue fixed in #124 was first reported by Nadim Kobeissi.

## Which versions are affected by GHSA-g433-pq76-6cmf?

8 open source packages ship an affected version, including hpke-rs and hpke-rs-rust-crypto.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `hpke-rs` | crates.io | All versions | 0.6.0 |
| `hpke-rs` | crates.io | All versions | 0.6.0 |
| `hpke-rs` | crates.io | From 0.0.0-0 | 0.6.0 |
| `hpke-rs` | crates.io | From 0.0.0-0 | 0.6.0 |
| `hpke-rs` | crates.io | From 0.0.0-0 | 0.6.0 |
| `hpke-rs-rust-crypto` | crates.io | All versions | 0.6.0 |
| `hpke-rs-rust-crypto` | crates.io | All versions | 0.6.0 |
| `hpke-rs-rust-crypto` | crates.io | From 0.0.0-0 | 0.6.0 |

## How do I fix GHSA-g433-pq76-6cmf?

Upgrade hpke-rs to 0.6.0 or later.

## Is GHSA-g433-pq76-6cmf being exploited?

There is no known exploitation of GHSA-g433-pq76-6cmf in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-g433-pq76-6cmf and fix it if it is affected.

What it is: GHSA-g433-pq76-6cmf is a vulnerability in hpke-rs, published on 4 Feb 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-g433-pq76-6cmf in the wild and no public exploit code.

Affected packages and fixed versions:
- hpke-rs (crates.io): affected all versions; fixed in 0.6.0
- hpke-rs (crates.io): affected all versions; fixed in 0.6.0
- hpke-rs (crates.io): affected from 0.0.0-0; fixed in 0.6.0
- hpke-rs (crates.io): affected from 0.0.0-0; fixed in 0.6.0
- hpke-rs (crates.io): affected from 0.0.0-0; fixed in 0.6.0
- hpke-rs-rust-crypto (crates.io): affected all versions; fixed in 0.6.0
- hpke-rs-rust-crypto (crates.io): affected all versions; fixed in 0.6.0
- hpke-rs-rust-crypto (crates.io): affected from 0.0.0-0; fixed in 0.6.0

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-g433-pq76-6cmf/ (Markdown: https://insights.sbomify.com/GHSA-g433-pq76-6cmf/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-g433-pq76-6cmf

---
From sbomify Insights: https://insights.sbomify.com/GHSA-g433-pq76-6cmf/
Summaries are generated and may contain mistakes; the official description above is the record.
