NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

CVE-2026-125334 — node-forge

MEDIUMFix: digitalbazaar/forge#1169

CVE-2026-125334 is a medium-severity (CVSS 5.9) NULL Pointer Dereference vulnerability in node-forge. A fix is available for node-forge — see the affected versions and patch details below.

Forge: TLS client crash on a handshake record received without a session

Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Nov 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

4Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
node-forgenpm
54.5Mdownloads / week

Description

Summary

A forge.tls client throws an uncaught TypeError from connection.process() when it receives a ServerHello while it has no session: after a close_notify alert or a call to close(), or before handshake() is called. A malicious server or an on-path attacker can use this to terminate a Node.js process. Fixed in node-forge 1.4.3.

Details

tls.handleHandshake() in lib/tls.js updates the handshake digests with c.session.md5.update(bytes) before it calls the message handler. A client creates its session in handshake(), and c.reset() sets it to null when the connection is closed. Closing doesn't set the fail flag, and the client goes back to expecting a ServerHello, so a Handshake record received afterwards still reaches handleHandshake(), which throws TypeError: Cannot read properties of null (reading 'md5').

This happens:

  • after the server sends a close_notify alert (at any alert level);
  • after the application calls close();
  • before the application calls handshake().

The exception propagates out of connection.process(). Applications that pass socket data to process() from a data event handler without catching exceptions, as in the README example, terminate. After a reset the connection uses no encryption, so an on-path attacker can inject the records even when the real server is honest.

Servers are not affected: a server creates its session when it receives a ClientHello.

The fix handles these records like other unexpected records on a closed client: they are ignored.

Patches

Fixed in node-forge 1.4.3.

Workarounds

Catch exceptions thrown by connection.process() and close the socket, or stop passing socket data to process() once the closed callback has been called and until handshake() is called again.

Resources

Severity

CVSS 3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H (5.9, Moderate) CVSS 4.0 (informational): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N (8.2) CVSS 4.0 has no counterpart to 3.1's AC:H beyond AT:P and scores this higher; the severity rating follows CVSS 3.1.

Credits

Reported by @manus-use.

Proof of concept

var c = forge.tls.createConnection({server: false, ...});
c.handshake();
// warning close_notify alert, then an empty ServerHello, in separate
// process() calls
c.process(forge.util.hexToBytes('15030100020100'));
c.process(forge.util.hexToBytes('160301000402000000'));
// <= 1.4.2: TypeError: Cannot read properties of null (reading 'md5')
// 1.4.3: the record is ignored

The reporter's PoC is in tests/pocs/ghsa-j8rw-jp99-435v.js, and regression tests are in tests/unit/tls.js.

Impact

Applications that use forge.tls as a client and pass data from a network socket to connection.process() are affected. The server they connect to, or an on-path attacker, can make process() throw; if the application doesn't catch it, the Node.js process terminates, dropping all its connections. Servers built on forge.tls are not affected. There is no confidentiality or integrity impact.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmnode-forgeall versions1.4.3npm install node-forge@1.4.3

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for node-forge, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update node-forge to 1.4.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-125334 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

Frequently Asked Questions

### Summary A `forge.tls` client throws an uncaught `TypeError` from `connection.process()` when it receives a ServerHello while it has no session: after a `close_notify` alert or a call to `close()`, or before `handshake()` is called. A malicious server or an on-path attacker can use this to terminate a Node.js process. Fixed in node-forge 1.4.3. ### Details `tls.handleHandshake()` in `lib/tls.js` updates the handshake digests with `c.session.md5.update(bytes)` before it calls the message handler. A client creates its session in `handshake()`, and `c.reset()` sets it to `null` when the conne
O3 Security · Impact-Aware SCA

Is CVE-2026-125334 in your dependencies?

Find it across npm, including transitive dependencies.

CVE-2026-125334: node-forge — Fixed in 1.4.3