Miggo Logo

CVE-2025-6545: pbkdf2 Predictable Key Generation Critical Vulnerability

N/A

CVSS Score

Basic Information

EPSS Score
0.31711%
Published
6/23/2025
Updated
6/23/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
pbkdf2npm>= 3.0.10, <= 3.1.23.1.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability exists in the pbkdf2 package, where the key derivation functions pbkdf2 and pbkdf2Sync can return predictable (zero-filled or uninitialized) buffers instead of cryptographically secure keys. This issue was introduced in commit 9699045c37a07f8319cfb8d44e2ff4252d7a7078.

The root cause is the replacement of the robust create-hmac library with a new, internal HMAC implementation. This new implementation, found in lib/sync.js, uses a hardcoded map of lowercase algorithm names (md5, sha1, sha256, etc.) to determine the hash output size.

When a developer provides an algorithm name that is not in this exact list—either a non-normalized form like 'SHA256' (with uppercase letters) or a different but valid algorithm like 'sha3-512'—the internal logic fails to find the corresponding size. Instead of throwing an error, the code proceeds with incorrect parameters, ultimately leading to the generation of an insecure, predictable output.

This is a critical vulnerability because it can lead to systems generating and using weak or empty keys for sensitive operations, completely undermining the security of the key derivation process. The issue is particularly insidious because it fails silently, giving no indication that the generated key is insecure.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry T*is *****ts *ot*: *. Unsupport** *l*os (*.*. `s***-***` / `s***-***` / `s*****-***`) *. Support** *ut non-norm*liz** *l*os (*.*. `S*****` / `S*****` / `S***` / `s**-*` / `s**-***` / `s**-***`) *ll o* t*os* work *orr**tly in No**.js,

Reasoning

T** vuln*r**ility *xists in t** `p*k***` p**k***, w**r* t** k*y **riv*tion *un*tions `p*k***` *n* `p*k***Syn*` **n r*turn pr**i*t**l* (z*ro-*ill** or uniniti*liz**) *u***rs inst*** o* *rypto*r*p*i**lly s**ur* k*ys. T*is issu* w*s intro*u*** in *ommit