IntelligenceFindingsNMN-2026-0076
@hpke/core reuses AEAD nonces
CandidateMachine- or researcher-generated; not independently verified.
In short
What to know.
- Package
- @hpke/core npm@hpke/core: before 1.7.5
- What to do
- Upgrade @hpke/core to 1.7.5 or later.
- Severity
- CriticalRated by the source advisory.
- Confidence
- HighThe affected range comes from the advisory; no system that uses the component has been assessed.
Verification
Where it stands.
- Candidate
- In review
- Reproduced
- Confirmed
- Resolved
- Disputed
- Withdrawn
6 listed
Sources
- OSV record GHSA-73g8-5h73-26h4osv.devRetrieved 3 December 2026
- web reference for GHSA-73g8-5h73-26h4github.comRetrieved 3 December 2026
- advisory reference for GHSA-73g8-5h73-26h4nvd.nist.govRetrieved 3 December 2026
- web reference for GHSA-73g8-5h73-26h4github.comRetrieved 3 December 2026
- package reference for GHSA-73g8-5h73-26h4github.comRetrieved 3 December 2026
- web reference for GHSA-73g8-5h73-26h4github.comRetrieved 3 December 2026
Full record
- Finding
- NMN-2026-0076
- Category
- vulnerability
- Component
- @hpke/core (npm)@hpke/core: before 1.7.5
- Severity
- Critical. Rated by the source advisory.Severity as labelled by the source advisory GHSA-73g8-5h73-26h4. CVSS as given: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N. Noumen has not assessed it.
- Confidence
- High.The affected range comes from the advisory; no system that uses the component has been assessed.
- State
- Candidate. Machine- or researcher-generated; not independently verified.
- Disclosure
- Public
- Mitigation
- Upgrade @hpke/core to 1.7.5 or later.
- Discovery method
- imported from a public advisory by the Advisory Monitor (1.0.0)Machine-generated by the agent advisory-monitor@1.0.0.
- Reproduction
- No reproduction steps recorded.
- Related advisories
- GHSA-73g8-5h73-26h4CVE-2025-64767
- Affected systems
- None listed. A link to a system needs its own evidence.
- Attribution
- Researcher: advisory-monitor@1.0.0 (agent, machine-generated)Validators: None yet
- Assigned reviewer
- Nobody yet
- Dates
- Created 3 December 2026, 16:49 UTCUpdated 3 December 2026, 16:49 UTC
Summary, as published by the source advisory
### Summary
The public SenderContext Seal() API has a race condition which allows for the same AEAD nonce to be re-used for multiple Seal() calls. This can lead to complete loss of Confidentiality and Integrity of the produced messages.
### Details
The SenderContext Seal() [implementation](https://github.com/dajiaji/hpke-js/blob/b7fd3592c7c08660c98289d67c6bb7f891af75c4/packages/core/src/senderContext.ts#L22-L34) allows for concurrent executions to trigger `computeNonce()` with the same sequence number. This results in the same nonce being used in the suite's AEAD.
### PoC
This code reproduces the issue (and also checks for more things that could be wrong with the implementation).
```js
import { CipherSuite, KdfId, AeadId, KemId } from "hpke-js";
const suite = new CipherSuite({
kem: KemId.DhkemP256HkdfSha256,
kdf: KdfId.HkdfSha256,
aead: AeadId.Aes128Gcm,
});
const keypair = await suite.kem.generateKeyPair();
const skR = keypair.privateKey;
const pkR = keypair.publicKey;
const sender = await suite.createSenderContext({
recipientPublicKey: pkR,
});
const [message0, message1] = await Promise.all([
sender.seal(
new TextEncoder().encode("Secret message 1: Attack at dawn").buffer
),
sender.seal(
new TextEncoder().encode("Secret message 2: Withdraw troops").buffer
),
]);
const recipient = await suite.createRecipientContext({
recipientKey: skR,
enc: sender.enc,
});
const plaintext0 = await recipient.open(message0);
console.log("✓ Decrypted message seq=0", new TextDecoder().decode(plaintext0));
try {
console.log(
"✓ Decrypted message seq=1",
new TextDecoder().decode(await recipient.open(message1))
);
console.log("\n✓ nonce-reuse reproduction completed, code is NOT vulnerable");
} catch (error) {
// re-sequence the recipient to verify same nonce was used for two messages
recipient._ctx.seq = 0;
console.log(
"❌ Decrypted a different message with seq=0",
new TextDecoder().decode(await recipient.open(message1))
);
console.log(
"\n✓ nonce-reuse reproduction completed, code is vulnerable, nonces are reused when concurrent calls to .seal() are used"
);
}
// Test that failed Open() doesn't increment sequence
const recipient2 = await suite.createRecipientContext({
recipientKey: skR,
enc: sender.enc,
});
const invalidMessage = new Uint8Array(message0.byteLength);
invalidMessage.set(new Uint8Array(message0));
invalidMessage[0] ^= 0xff; // Corrupt the first byte
try {
await recipient2.open(invalidMessage.buffer);
} catch {}
// Now try to open the first valid message - should still work with seq=0
try {
await recipient2.open(message0);
console.log("✓ Successfully decrypted message with seq=0 after failed open()");
console.log("✓ Failed open() did NOT increment sequence");
} catch (error) {
console.log("❌ Failed to decrypt message - sequence was incorrectly incremented");
}
// Test that same message produces same ciphertext due to nonce reuse
const sender2 = await suite.createSenderContext({
recipientPublicKey: pkR,
});
const sameMessage = new TextEncoder().encode("Identical message").buffer;
const [cipher0, cipher1] = await Promise.all([
sender2.seal(sameMessage),
sender2.seal(sameMessage),
]);
const cipher0Array = new Uint8Array(cipher0);
const cipher1Array = new Uint8Array(cipher1);
let identical = true;
if (cipher0Array.length !== cipher1Array.length) {
identical = false;
} else {
for (let i = 0; i < cipher0Array.length; i++) {
if (cipher0Array[i] !== cipher1Array[i]) {
identical = false;
break;
}
}
}
if (identical) {
console.log("\n❌ Same message produced IDENTICAL ciphertext (nonce reuse confirmed)");
} else {
console.log("\n✓ Same message produced different ciphertext (nonces are unique)");
}
```
### Recommendation
Implement a synchronization mechanism such that only one seal()/open() per context can be executed at a time.
### Notes
Refs: https://github.com/hpkewg/hpke/issues/38
> https://www.rfc-edit
1 event, oldest first
History
History verified: 1 eventLatest hash725182b88960725182b8896070f8acdc811b68574eeec9777aa25b316af964f8d0a95d92a546
Record createdMachine-generated
By advisory-monitor@1.0.0 (agent, machine-generated)
Reason: Imported from public advisory GHSA-73g8-5h73-26h4.
Entered the record in the state Candidate.
Event 1 hash725182b88960725182b8896070f8acdc811b68574eeec9777aa25b316af964f8d0a95d92a546
About this record
Severity and confidence are rated separately, each with its own reason.
History events are never edited or deleted. Each stores the hash of the one before, so a later change breaks the chain.
Corrections keep the value before and after.