GitHub Advisoryadvisory · npm
GHSA-v62p-rq8g-8h59 pbkdf2 silently disregards Uint8Array input, returning static keys
CRITICAL
Official page ↗
- Aliases
- CVE-2025-6547
- Ecosystem
- npm
- Packages
- pbkdf2
- Severity
- Critical
- CVSS vector
- CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:H/SI:H/SA:H
- Weaknesses
- CWE-20
- Reviewed
- 2025-06-23
Affected packages
• npm pbkdf2: >= 1.0.0, < 3.1.3 → fixed in 3.1.3
Description
Summary
On historic but declared as supported Node.js versions (0.12-2.x), pbkdf2 silently disregards Uint8Array input
This only affects Node.js = 0.12](https://github.com/browserify/pbkdf2/blob/v3.1.2/package.json#L62) (and there seems to be ongoing effort in this repo to maintain that)
• Support `Uint8Array` input (input is typechecked against Uint8Array, and the error message includes e.g. "Password must be a string, a Buffer, a typed array or a DataView"
Details
The error is in `toBuffer` method
This vulnerability somehow even made it to tests: https://github.com/browserify/pbkdf2/commit/eb9f97a66ed83836bebc4ff563a1588248708501
There, `resultsOld` (where mismatch `results`) are just invalid output generated from empty password/salt instead of the supplied one
PoC
On Node.js/io.js require('pbkdf2').pbkdf2Sync(new Uint8Array([1,2,3]), new Uint8Array([1,3,4]), 1024, 32, 'sha256')
// But that's just a hash of empty data with empty password:
> require('pbkdf2').pbkdf2Sync('', '', 1024, 32, 'sha256')
// Node.js crypto is fine even on that version:
> require('crypto').pbkdf2Sync(new Uint8Array([1,2,3]), new Uint8Array([1,3,4]), 1024, 32, 'sha256')
// Empty hash from Node.js, for comparison
> require('crypto').pbkdf2Sync('', '', 1024, 32, 'sha256')
```
Impact
Static hashes being outputted and used as keys/passwords can completely undermine security
That said, no one should be using those Node.js versions anywhere now, so I would recommend to just drop them
This lib should not pretend to work on those versions while outputting static data though
Just updating to a fixed version is not enough: if anyone was using `pbkdf2` lib (do not confuse with Node.js `crypto.pbkdf2`) or anything depending on it with Node.js/io.js < 3.0.0, recheck where those keys went / how they were used, and take action accordingly
Related
Alias · CVE (1)
- CVE-2025-6547 Improper Input Validation vulnerability in pbkdf2 allows Signature Spoofing by Improper Validation.This issue affects pbkdf2: <=3.1.2. vulnerability
Weakness · CWE (1)
- CWE-20 Improper Input Validation weakness