CVE-2025-6547: On Node.js < 3, pbkdf2 silently disregards Uint8Array input, returning static keys

Published Jun 23, 2025
·
Updated

Summary

On historic but declared as supported Node.js versions (0.12-2.x), pbkdf2 silently disregards Uint8Array input

This only affects Node.js <3.0.0, but pbkdf2 claims to: Support Node.js >= 0.12 (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 < 3.0.0

console > require('pbkdf2').pbkdf2Sync(new Uint8Array([1,2,3]), new Uint8Array([1,3,4]), 1024, 32, 'sha256') <Buffer 21 53 cd 5b a5 f0 15 39 2f 68 e2 40 8b 21 ba ca 0e dc 7b 20 d5 45 a4 8a ea b5 95 9f f0 be bf 66>

// But that's just a hash of empty data with empty password: > require('pbkdf2').pbkdf2Sync('', '', 1024, 32, 'sha256') <Buffer 21 53 cd 5b a5 f0 15 39 2f 68 e2 40 8b 21 ba ca 0e dc 7b 20 d5 45 a4 8a ea b5 95 9f f0 be bf 66>

// 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') <Buffer 78 10 cc 84 b7 bb 85 cd c8 37 ca 68 da a9 4c 33 db ae c2 3d 5b d4 95 76 da 33 f9 95 ac 51 f4 45>

// Empty hash from Node.js, for comparison > require('crypto').pbkdf2Sync('', '', 1024, 32, 'sha256') <Buffer 21 53 cd 5b a5 f0 15 39 2f 68 e2 40 8b 21 ba ca 0e dc 7b 20 d5 45 a4 8a ea b5 95 9f f0 be bf 66>

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

Other sources

Improper Input Validation vulnerability in pbkdf2 allows Signature Spoofing by Improper Validation.This issue affects pbkdf2: <=3.1.2.

NVD

Improper Input Validation vulnerability in pbkdf2 allows Signature Spoofing by Improper Validation.This issue affects pbkdf2: =3.1.2.

IBM

Affected Software

3 affected componentsFixes available
Node.js pbkdf2<=3.1.2
npm/pbkdf2<=3.1.2
3.1.3
IBM watsonx.data intelligence<=5.2.0, 5.2.1, 5.2.2, 5.3.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/pbkdf2 to a version that resolves this vulnerability.

    Fixed in 3.1.3
  2. Upgrade

    Upgrade pbkdf2 to a version that resolves this vulnerability.

    Fixed in 3.1.2
  3. Configuration

    Do not rely on pbkdf2 with Uint8Array input on Node.js/io.js < 3.0.0; the issue is in the `toBuffer` method where `resultsOld` mismatch leads to invalid output generated from empty password/salt instead of the supplied values.

    pbkdf2 (toBuffer method) Uint8Array input handling = reject/avoid Uint8Array on Node.js < 3.0.0
  4. Compensating control

    If any deployments still run Node.js/io.js < 3.0.0 (where pbkdf2 silently disregards Uint8Array input and returns static keys), recheck where the derived keys/passwords were used and take action accordingly (treat derived keys/passwords as potentially compromised).

  5. Operational

    For any derived keys/passwords produced on Node.js/io.js < 3.0.0 using Uint8Array input, rotate/re-generate those keys/passwords because pbkdf2 can output static data (static hashes being outputted and used as keys/passwords can undermine security).

Event History

Jun 23, 2025
CVE Published
via MITRE·07:00 PM
Data Sourced
via MITRE·07:00 PM
DescriptionWeakness
Data Sourced
via NVD·07:15 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·10:42 PM
Data Sourced
via GitHub·10:42 PM
DescriptionWeaknessAffected Software
Jun 24, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-6547?

CVE-2025-6547 is classified as a moderate severity vulnerability due to its potential for signature spoofing.

2

How do I fix CVE-2025-6547?

To mitigate CVE-2025-6547, upgrade the pbkdf2 package to version 3.1.3 or later.

3

What impact does CVE-2025-6547 have on my application?

CVE-2025-6547 can allow attackers to perform signature spoofing, compromising the integrity of data.

4

Which versions of pbkdf2 are affected by CVE-2025-6547?

CVE-2025-6547 affects the pbkdf2 package versions up to and including 3.1.2.

5

Is CVE-2025-6547 related to other vulnerabilities?

CVE-2025-6547 is specifically related to improper input validation, but may exhibit similar behaviors to other spoofing vulnerabilities.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203