Improper Validation of Specified Quantity in Input Affecting node-forge package, versions <1.4.1


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.13% (3rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-NODEFORGE-22113984
  • published1 Nov 2026
  • disclosed26 Oct 2026
  • creditThai

Introduced: 26 Oct 2026

NewCVE-2026-118782  (opens in a new tab)
CWE-1284  (opens in a new tab)
CWE-354  (opens in a new tab)

How to fix?

Upgrade node-forge to version 1.4.1 or higher.

Overview

node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.

Affected versions of this package are vulnerable to Improper Validation of Specified Quantity in Input in the pkcs12.pkcs12FromAsn1 function in lib/pkcs12.js and the pki.pbe.generatePkcs12Key key derivation in lib/pbe.js. An attacker can alter a PFX file, substitute certificates or an unencrypted private key, and compute a MAC that verifies under any password, by setting MacData.iterations to zero or less, because the PKCS#12 key derivation then runs its hash loop zero times and returns a constant that does not depend on the password or salt (the MAC key becomes the diversifier byte 0x03 repeated 20 times, and PBE derives constant key and IV bytes 0x01 and 0x02). This affects applications that import PKCS#12/PFX files or PKCS#8 encrypted keys from untrusted sources and rely on the MAC or on successful decryption to establish provenance, while PBES2 (PBKDF2) encrypted content is unaffected.

CVSS Base Scores

version 4.0
version 3.1