Skip to content
Crypto Disclosed report Advanced CVE-2026-21713

Timing side-channel in HMAC verification via memcmp() in crypto_hmac.cc leads to potential MAC forgery

HMAC verification in Node.js used a non-constant-time comparison, potentially leaking timing information proportional to matching bytes. Under certain threat models, this could serve as a timing oracle to infer HMAC values.

x_probe Follow

Originally disclosed on HackerOne

Medium 5.9 View original
  • Triaged in 22 hours
  • Fixed in 51 days
  • Disclosed after 57 days

Summary by the program

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.

The original report as published on HackerOne, by x_probe. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the HMAC verification used a standard memory comparison that returns early on the first mismatched byte instead of a constant-time comparison.

Impact

Under certain threat models where high-resolution timing measurements are possible, this could be exploited as a timing oracle to infer HMAC values, though the text does not demonstrate a practical forgery.

What the attacker needed

High-resolution timing measurements

The fix

The comparison should be replaced with a constant-time comparison primitive, which Node.js already provides elsewhere in the codebase.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

An HMAC checks a message has not been tampered with using a secret key. The check compared values in a way that was not constant-time, potentially leaking timing information proportional to matching bytes. An attacker who can measure time precisely might use that to infer HMAC values.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More from Node.js

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.