Uncontrolled Recursion 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.43% (38th 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-22114200
  • published1 Nov 2026
  • disclosed26 Oct 2026
  • creditEthan Kim, Youngjoon Kim, Arpit Jain, Mike Read

Introduced: 26 Oct 2026

NewCVE-2026-119191  (opens in a new tab)
CWE-674  (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 Uncontrolled Recursion in the asn1.fromDer function in lib/asn1.js. An attacker can drive CPU and memory high enough to abort the Node.js process with a small DER or PEM structure containing nested BIT STRINGs, because the default BIT STRING decode path in _fromDer() starts with an options object that omits maxDepth, so the depth check compares against undefined and never fires, and each nested BIT STRING's contents are deep-copied by asn1.create(), making memory grow quadratically with nesting depth. This triggers under default options through any API that parses DER or PEM, including pki.certificateFromPem(), pki.publicKeyFromPem(), the PKCS#7, PKCS#8, and PKCS#12 loaders, and server certificates received by the forge TLS client.

Workaround

This vulnerability can be avoided by direct callers of forge.asn1.fromDer() passing {decodeBitStrings: false}, which stops the nested decode but changes the parsed structure, so it does not help the higher-level PKI, PKCS, and TLS APIs that do not expose the option.

Note: This is a bypass of the fix for the vulnerability described in CVE-2025-66031.

CVSS Base Scores

version 4.0
version 3.1