CVE-2026-21713
Received Received - Intake
Timing Attack in Node.js HMAC Verification Leaks Secrets

Publication date: 2026-03-30

Last updated on: 2026-03-30

Assigner: HackerOne

Description
A flaw in Node.js HMAC verification uses a non-constant-time comparison when validating user-provided signatures, potentially leaking timing information proportional to the number of matching bytes. Under certain threat models where high-resolution timing measurements are possible, this behavior could be exploited as a timing oracle to infer HMAC values. Node.js already provides timing-safe comparison primitives used elsewhere in the codebase, indicating this is an oversight rather than an intentional design decision. This vulnerability affects **20.x, 22.x, 24.x, and 25.x**.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-30
Last Modified
2026-03-30
Generated
2026-05-07
AI Q&A
2026-03-30
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
nodejs node.js From 20.x (inc) to 25.x (inc)
nodejs node.js From 20.0 (inc) to 26.0 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-UNKNOWN
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability is a flaw in Node.js's HMAC verification process where a non-constant-time comparison is used to validate user-provided signatures.

Because the comparison time varies depending on the number of matching bytes, it can leak timing information.

An attacker with the ability to make high-resolution timing measurements could exploit this behavior as a timing oracle to infer HMAC values.

This is considered an oversight since Node.js provides timing-safe comparison functions elsewhere in its codebase.


How can this vulnerability impact me? :

The vulnerability can allow an attacker to infer HMAC values by measuring the time it takes to verify signatures.

This could lead to unauthorized access or data tampering if HMACs are used to protect sensitive data or verify message integrity.

However, exploitation requires a threat model where high-resolution timing measurements are possible, which may limit the practical impact.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart