CVE-2025-6547:
pbkdf2 Uint8Array Input Validation Static Key Generation Vulnerability
9.1
CVSS ScoreBasic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
pbkdf2 | npm | <= 3.1.2 | 3.1.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability exists in the pbkdf2
npm package and affects applications running on Node.js versions older than 3.0.0. The core of the issue lies in the improper handling of Uint8Array
data types for passwords and salts.
The root cause is a flawed type-checking and conversion mechanism within an internal utility function located in lib/to-buffer.js
. In vulnerable versions, this function fails to correctly convert Uint8Array
inputs into Buffers, causing them to be treated as empty. This flaw was fixed in commit e3102a8cd4830a3ac85cd0dd011cc002fdde33bb
by introducing an external dependency, to-buffer
, which correctly handles these types.
The user-facing functions, pbkdf2
(asynchronous) and pbkdf2Sync
(synchronous), are the entry points for this vulnerability. When developers use these functions with Uint8Array
inputs on an affected Node.js version, the toBuffer
utility's failure leads to the cryptographic operations being performed on empty strings. This results in the generation of a static, predictable key, which completely undermines the security of the key derivation process.
Therefore, a security engineer should be aware that any part of their system using the pbkdf2
library's pbkdf2
or pbkdf2Sync
functions on an outdated Node.js runtime is at risk. Exploitation would result in weak, predictable cryptographic keys being used, which could lead to a total compromise of the data or systems protected by these keys. The fix is to update the pbkdf2
package to version 3.1.3 or later.
Vulnerable functions
toBuffer
lib/to-buffer.js
pbkdf2Sync
lib/sync.js
pbkdf2
lib/async.js