Advisory

RUSTSEC-2026-0071

Also known as: GHSA-g433-pq76-6cmf, RUSTSEC-2026-0069, RUSTSEC-2026-0070, RUSTSEC-2026-0072

Summary

Nonce Reuse in HPKE Context

Details

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.

Severity

Not rated by the source.

Dates

Published
2026-02-05 12:00 UTC
Modified
2026-03-24 08:41 UTC

Affected packages and fixes

hpke-rs

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.6.0 (semver)

Fixed versions

0.6.0

Fix

  • Fixed version 0.6.0
    cargo update -p hpke-rs --precise 0.6.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences