Skip to content

docs: document zeroization scope and the HKDF/HMAC state limitation - #20

Merged
nadimkobeissi merged 1 commit into
symbolicsoft:mainfrom
10d9e:security/document-zeroization-scope
Jul 24, 2026
Merged

docs: document zeroization scope and the HKDF/HMAC state limitation#20
nadimkobeissi merged 1 commit into
symbolicsoft:mainfrom
10d9e:security/document-zeroization-scope

Conversation

@10d9e

@10d9e 10d9e commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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/hmac crates do not zeroize their internal HMAC state on drop. Each LabeledExtract/LabeledExpand (e.g. the discarded Hkdf half of HkdfExtract::finalize() in src/kdf.rs, and the per-call Hkdf::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

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>
@nadimkobeissi

Copy link
Copy Markdown
Member

Please don't spam AI-generated PRs.

@nadimkobeissi

Copy link
Copy Markdown
Member

It was unfair of me to reject this, sorry.

@nadimkobeissi
nadimkobeissi merged commit 060658d into symbolicsoft:main Jul 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants