# RUSTSEC-2026-0070: Panic When Opening or Sealing on Export-Only Context

- Database: RustSec
- Published: 2026-02-11
- 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-0071](https://cve.now/RUSTSEC-2026-0071.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

Constructing an HPKE Context with the AEAD algorithm set to
`HpkeExport` resulted in a panic when calling `Context::seal`, or
`Context::open`. This was due to an underflowing integer subtraction
when calculating the length of a vector allocation for the AEAD nonce,
which would panic on its own in debug mode and cause out-of-memory
abort on the allocation in release mode.

## Impact
Applications that could be made to use an HPKE context configured with
`HpkeExport` as AEAD algorithm to open or seal a ciphertext would
crash. Other applications are unaffected.

## Mitigation
Starting with version `0.6.0`, an error will be returned when
attempting to call `Context::seal` or `Context::open` on an HPKE
context with `HpkeExport` as AEADAlgorithm.

## References

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

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

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