Improper Certificate Validation Affecting node-forge package, versions <1.4.3


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.23% (15th 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-22409017
  • published11 Nov 2026
  • disclosed10 Nov 2026
  • creditbhaswanthc

Introduced: 10 Nov 2026

NewCVE-2026-125336  (opens in a new tab)
CWE-295  (opens in a new tab)

How to fix?

Upgrade node-forge to version 1.4.3 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 Certificate Validation via pki.verifyCertificateChain() in lib/x509.js, which does not decode or enforce the X.509 nameConstraints extension (OID 2.5.29.30) during certificate path validation. A certificate authority whose nameConstraints extension is marked non-critical can issue a leaf certificate with a subjectAltName dNSName or subject commonName outside its permitted subtrees or inside its excluded subtrees, and the chain passes verification. This allows an attacker holding such a CA's private key, or able to obtain a certificate issued under it, to impersonate arbitrary names - including in TLS peer verification via forge.tls - defeating the namespace restriction the constraint was intended to enforce.

Note: This is only exploitable when a name-constrained CA with a non-critical nameConstraints extension chains to a root trusted by the application, and the attacker controls that CA's private key or can obtain an out-of-scope certificate from it. Chains without nameConstraints are unaffected, and chains with a critical nameConstraints extension were already rejected.

Workaround

Pass an options.verify callback to pki.verifyCertificateChain() (or verify to forge.tls.createConnection()) that returns an error when any CA certificate in the chain has an extension with id 2.5.29.30. This rejects all chains below a name-constrained CA, including valid ones. Trust anchors with the extension must be checked separately.

CVSS Base Scores

version 4.0
version 3.1