docs: document zeroization scope and the HKDF/HMAC state limitation - #20
Merged
nadimkobeissi merged 1 commit intoJul 24, 2026
Merged
Conversation
The README's security posture covered constant-time properties but not memory-hygiene guarantees. Add a Zeroization section stating what the crate scrubs, and disclose the one gap it cannot close: the RustCrypto hkdf/hmac crates do not zeroize internal HMAC state on drop, so PRK-derived ipad/opad block state transiently survives in freed memory after every extract/expand. Shared by all RustCrypto-based HPKE implementations; documented so deployments with a memory-forensics threat model can compensate (no core dumps, encrypted swap). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
|
Please don't spam AI-generated PRs. |
Member
|
It was unfair of me to reject this, sorry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
From a security review of v0.1.0: the crate's own zeroization discipline is excellent — private keys, shared secrets, PRKs, seeds, and the derived AEAD key/base nonce are all scrubbed, including manual scrubs where upstream types lack zeroize-on-drop. But one gap can't be closed from this crate, and it wasn't disclosed anywhere: the RustCrypto
hkdf/hmaccrates do not zeroize their internal HMAC state on drop. EachLabeledExtract/LabeledExpand(e.g. the discardedHkdfhalf ofHkdfExtract::finalize()insrc/kdf.rs, and the per-callHkdf::from_prk) leaves PRK-derived ipad/opad block state — key-equivalent material — transiently in freed memory.Since the README already carries a constant-time disclosure table, this adds the matching memory-hygiene disclosure: a Zeroization section stating what is scrubbed, the known limitation, why it's ecosystem-wide, and what deployments with a memory-forensics threat model should do about it (no core dumps, encrypted swap).
Documentation only; no code changes.
🤖 Generated with Claude Code