CVE-2025-6545: pbkdf2 Predictable Output for Unsupported and Non-Normalized Algorithms
Summary
CVE-2025-6545: pbkdf2 returns predictable uninitialized/zero-filled memory for non-normalized or unimplemented algos. Affects pbkdf2 versions >= 3.0.10, < 3.1.3. Fixed in 3.1.3. How to fix ↓
Also tracked for
- node-pbkdf2 · Debian:11
The same CVE-2025-6545 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The 'pbkdf2' package is a widely used cryptographic library in the Node.js ecosystem that implements the PBKDF2 key derivation function. It is designed to enhance security by making brute-force attacks more difficult through the use of a salt and multiple iterations. However, certain versions of this package have a vulnerability that allows for predictable output when using unsupported or non-normalized algorithms, undermining the security of derived keys.
Vulnerability Detail
The vulnerability arises from the handling of unsupported algorithms (like 'sha3-256', 'sha3-512', and 'sha512-256') and non-normalized algorithm names (like 'Sha256', 'SHA1', etc.). When these algorithms are used, the 'pbkdf2' implementation returns predictable output, which can lead to security breaches. Specifically, in Node.js environments, uninitialized memory is returned, while in browser environments, zero-filled buffers are returned. This can result in weak keys being generated, making applications susceptible to attacks.
How To Fix
Latest published version: 3.1.7 as of 23 Oct 2026
npm install pbkdf2@3.1.7
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
3.1.3
This is the first release that contains the fix.
npm install pbkdf2@3.1.3
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate upgrading is not feasible, avoid using unsupported or non-normalized algorithms in your key derivation processes. Instead, stick to the following supported algorithms: 'md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'rmd160', and 'ripemd160'. Here is an example of how to use a supported algorithm:
const crypto = require('crypto');
const key = crypto.pbkdf2Sync('secret', 'salt', 100000, 64, 'sha256');
console.log(key.toString('hex'));
Conclusion
The vulnerability CVE-2025-6545 in the 'pbkdf2' package poses a significant risk by allowing predictable key outputs for certain algorithms. It is crucial to update to the patched version or implement workarounds to mitigate potential security threats.
See every vulnerability recorded for pbkdf2 →
FAQ
CVE-2025-6545 is a vulnerability in the 'pbkdf2' package that allows for predictable output when using unsupported or non-normalized algorithms, compromising the security of derived keys.
You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software. Check your application against CVE-2025-6545 using the Vulert playground at Vulert Scanner.
The consequences include the generation of weak keys that can be easily predicted, making applications vulnerable to brute-force attacks and other security breaches.
You can update the package by running the command 'npm install pbkdf2@3.1.3' in your project directory to ensure you are using a secure version.
If you cannot upgrade, avoid using unsupported or non-normalized algorithms in your key derivation processes and stick to the supported algorithms listed in the documentation.
References
Related vulnerabilities
Recent vulnerabilities recorded for pbkdf2.