# RUSTSEC-2026-0071: Nonce Reuse in HPKE Context

- Database: RustSec
- Published: 2026-02-05
- Modified: 2026-03-24

## Also published as

- [GHSA-G433-PQ76-6CMF](https://cve.now/GHSA-G433-PQ76-6CMF.md) (GitHub)
- [RUSTSEC-2026-0069](https://cve.now/RUSTSEC-2026-0069.md) (RustSec)
- [RUSTSEC-2026-0070](https://cve.now/RUSTSEC-2026-0070.md) (RustSec)
- [RUSTSEC-2026-0072](https://cve.now/RUSTSEC-2026-0072.md) (RustSec)

## Affected versions

- hpke-rs (crates.io): fixed in 0.6.0

## Description

The sequence number that is used to compute the AEAD nonce when using
a re-usable HPKE context is incremented after each seal or open
operation. This sequence number was stored as a `u32` and used regular
addition on `u32` for the increment, meaning in release mode it would
silently wrap around to 0 after 2^32 seal or open operations.

## Impact
Nonce reuse causes catastrophic breakage of AEAD ciphers, enabling
plaintext recovery attacks and authentication tag forgeries, depending
on the concrete AEAD.

This bug impacts applications that use hpke-rs to encrypt a large
number of messages using the same context. Applications using the
one-shot APIs are unaffected.

## Mitigation
Starting with version `0.6.0`, `checked_add` is used to increment the
sequence number, which avoids a silent wraparound in release
mode. Additionally, the sequence number is now stored as a `u64`,
increasing the maximally allowed number of seal and open operations on
a given HPKE context.

## References

- https://crates.io/crates/hpke-rs
- https://rustsec.org/advisories/RUSTSEC-2026-0071.html
- https://github.com/cryspen/hpke-rs/pull/123

Page: https://cve.now/RUSTSEC-2026-0071

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
