High impactSecurityPatch available

node-forge CVE-2026-119191: the 1.3.2 fix was incomplete, upgrade to 1.4.1

A depth limit added to node-forge for CVE-2025-66031 was skipped inside BIT STRING decoding, so teams on 1.3.2 can still have processes killed by an out-of-memory error the application cannot catch.

Khalid Aboubakr Engineering DeskPublished

Automated engineering analysis by the Khalid Aboubakr Engineering Desk, from the primary sources listed below. Not reviewed by a person before publication. About the desk

Bottom line

A fix is available: node-forge 1.4.1 patches CVE-2026-119191. Every release up to and including 1.4.0 is affected, including 1.3.2, the version that fixed CVE-2025-66031. Any Node.js service or client that parses untrusted certificates, keys or PKCS files with node-forge should move to 1.4.1, including copies pulled in through other packages; for the high-level PKI, PKCS and TLS APIs, upgrading is the only fix.

What happened

GitHub advisory GHSA-rhr8-3pm8-cq29 (CVE-2026-119191) covers node-forge, a JavaScript implementation of TLS and PKI. It was published in the digitalbazaar/forge repository on 27 October 2026. NVD published the CVE on 29 October 2026, and the GitHub Advisory Database reviewed it on 10 November 2026.

The flaw sits in asn1.fromDer(). By default, this function decodes the contents of BIT STRING values as ASN.1. That inner decode ignored the maxDepth recursion limit, and the advisory itself calls this "an incomplete fix of CVE-2025-66031". The earlier issue, GHSA-554w-wpv2-vw27, was unbounded recursion in asn1.fromDer. It could crash or incapacitate the parsing process, affected versions below 1.3.2 and was fixed in 1.3.2.

The new advisory describes a second problem in the same code. Nested BIT STRINGs were also decoded, and each one kept a deep copy of its contents. As a result, memory use grows quadratically with nesting depth, even when the nesting stays inside the default limit. Small crafted inputs can abort the Node.js process with a fatal out-of-memory error that the application cannot catch.

The advisory says the following entry points are reachable:

  • pki.certificateFromPem()
  • pki.publicKeyFromPem()
  • the PKCS#7, PKCS#8 and PKCS#12 loaders
  • server certificates received by forge's TLS client

The advisory database lists versions <= 1.4.0 as vulnerable and 1.4.1 as the first patched release. The advisory rates the issue High: CVSS 3.1 score 7.5, with availability as the only impact.

Why it matters

The important point is the version range. The two advisories overlap in a way that dependency scanners and change tickets can easily hide:

VersionCVE-2025-66031CVE-2026-119191
< 1.3.2VulnerableVulnerable
1.3.2 – 1.4.0FixedVulnerable
1.4.1FixedFixed

A team that closed the 2025 ticket by moving to 1.3.2 still has the same class of problem, now reached through a different path.

The failure itself is a fatal "JavaScript heap out of memory" error that, per the advisory, the application cannot catch. The process dies.

The advisory's own figures, measured on Node.js 24, show how little input is needed:

  • about 10 KB of input used about 600 MB
  • about 25 KB aborted a process limited to a 512 MB heap
  • about 200 KB aborted a process with the default heap
  • a 20 KB certificate PEM used 1.3 GB before being rejected

There is no confidentiality or integrity impact. This is denial of service, and the advisory describes the attacker as remote and unauthenticated: it is enough to get a crafted key or certificate parsed, or to serve one to a forge TLS client.

Engineering assessment

Our assessment: this is a real, cheap-to-trigger availability bug for any system that parses certificates, keys or PKCS containers supplied by someone else. The obvious targets include:

  • certificate or CSR upload endpoints
  • "bring your own key" features
  • PKCS#12 import
  • S/MIME or PKCS#7 handling
  • outbound TLS through forge to endpoints you do not control

Where node-forge only parses certificates the team generated itself, real exposure is low. The CVSS score does not distinguish between these cases; your data flow does.

The failure mode is also harder to contain than the original. The 2025 advisory describes a RangeError stack overflow, while the new advisory describes an out-of-memory abort the application cannot catch. The desk's inference is that in-process safety nets such as try/catch, error middleware or process.on('uncaughtException') should not be relied on here; containment has to happen at the process level.

The most useful lesson is about process. A dependency "fixed" against one advisory is not necessarily fixed against its sequel. The first patch added a depth limit, but did not pass it into a code path that built a fresh options object. That is an ordinary bug, and it means the 2025 remediation should be treated as partial. If your vulnerability tracking marks node-forge as resolved at 1.3.2, that record is now wrong.

Mitigation options are narrow:

  • decodeBitStrings: false. This workaround helps only code that calls forge.asn1.fromDer() directly, and it changes the parsed structure.
  • High-level APIs. The PKI, PKCS and TLS APIs, which is where most applications actually use forge, do not expose that option. For them, upgrading is the only remedy.
  • Input size caps. These are weak on their own. The advisory reports roughly 600 MB of memory use from about 10 KB of input, which is within the size range a legitimate upload limit would allow.

Compatibility risk from 1.4.1 looks low but is not zero. The fix decodes only one level of BIT STRING contents. Deeper or over-limit contents are kept as undecoded BIT STRING values, and toDer() writes their original bytes. Code that walked nested decoded BIT STRINGs must now call asn1.fromDer() on the inner value explicitly. The advisory indicates common structures such as SubjectPublicKeyInfo use only one level, so typical certificate and key parsing should be unaffected; bespoke ASN.1 tooling is where breakage is most likely.

The harder migration problem is transitive dependencies. node-forge often arrives indirectly, and the evidence does not say which widely used packages pin it at or below 1.4.0.

Is this you?

  • npm ls node-forge --all (or yarn why node-forge, pnpm why node-forge) shows any version <= 1.4.0, including 1.3.2.
  • Your code, or a dependency, calls pki.certificateFromPem(), pki.publicKeyFromPem(), the PKCS#7/#8/#12 loaders or asn1.fromDer() on data that comes from users, partners or the network.
  • You use forge's TLS client to connect to servers you do not fully control.
  • You closed CVE-2025-66031 by upgrading to 1.3.2 and have not revisited it since.
  • Lower concern: forge is present only in build tooling, or it only parses material your own systems generate.

What to do

  1. Inventory now. Run npm ls node-forge --all in every service, worker and front-end bundle that ships node-forge. Check lockfiles in CI as well as running images.
  2. Upgrade to node-forge 1.4.1 wherever forge parses untrusted input. Do this first; for the high-level PKI, PKCS and TLS APIs it is the only vendor remedy. For a direct dependency, run npm install node-forge@1.4.1.
  3. Force transitive copies up. Not vendor guidance: if an upstream package pins forge at <= 1.4.0, use your package manager's override or resolution mechanism to force 1.4.1. Then run that package's tests and raise an issue upstream.
  4. Test the parsing change. Re-run the certificate, key and PKCS fixtures you already have. Pay particular attention to any code that walks decoded BIT STRING contents more than one level deep. If such code exists, decode the inner value explicitly with asn1.fromDer(), as the advisory describes.
  5. Direct fromDer callers who cannot upgrade immediately can pass {decodeBitStrings: false} if they do not need encapsulated contents decoded. Verify downstream code against the changed structure.
  6. Contain the blast radius. Not vendor guidance: parse untrusted certificates and keys in a separate, restartable process rather than in the main request-serving process. Make sure your orchestrator restarts processes that die from an out-of-memory abort and alerts on repeated restarts.
  7. Correct your records. Reopen any ticket that marked node-forge as remediated at 1.3.2, and set 1.4.1 as the minimum version in policy or dependency scanning rules.

What we don't know yet

  • Attacker activity. The evidence contains no KEV listing or vendor statement on attacker activity for CVE-2026-119191. The only CISA SSVC entry in the evidence covers the earlier CVE-2025-66031.
  • Transitive exposure. The evidence does not say which widely used packages depend on node-forge and pin a version at or below 1.4.0.
  • Real-world breakage. It is not yet known whether one-level BIT STRING decoding in 1.4.1 breaks real-world parsing beyond custom ASN.1 code.
  • Interim input limits. There is no official guidance on safe input size limits.

The desk will watch for updated advisory data and downstream package releases that move to 1.4.1.

Sources

Latest engineering analysis

6 min read

zod-msg-tools 0.1.4: npm malware hides an auth-bypassing SQL backdoor

A fake Zod helper on npm patches Node's HTTP server at runtime and adds a hidden endpoint that sits in front of your router and auth, runs queries on your database pools and, where the psql client is present, can reach OS command execution on Postgres deployments.