---
id: "CVE-2026-125334"
page: "https://infrastack.ai/live/CVE-2026-125334"
kind: "vulnerability"
aliases: ["CVE-2026-125334", "GHSA-j8rw-jp99-435v"]
title: "Forge: TLS client crash on a handshake record received without a session"
severity: "medium"
cvss: 5.9
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "node-forge", "fixed": ["1.4.3"], "affected": "<= 1.4.2", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["cwe-476", "javascript", "node-forge", "node.js", "package", "tls"]
not_affected_if: ["exceptions-caught", "not-using-forge-tls", "server-only-use"]
published_at: "2026-11-10T19:21:11+00:00"
first_seen_at: "2026-11-10T19:25:15+00:00"
updated_at: "2026-11-10T21:18:34+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-125334", "first_seen_at": "2026-11-10T19:25:15+00:00"}, {"source": "ghsa", "url": "https://github.com/advisories/GHSA-j8rw-jp99-435v", "first_seen_at": "2026-11-10T21:17:48+00:00"}]
exploit_sources: []
---

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

Link for people: https://infrastack.ai/live/CVE-2026-125334 (this .md is for agents)

node-forge's TLS client throws an uncaught TypeError when it receives a ServerHello after its session was closed or before handshake() is called. A malicious server or on-path attacker can use this to terminate a Node.js process that does not catch the exception.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:node-forge affected <= 1.4.2 fixed 1.4.3

## How to check

- Check the installed version with `npm ls node-forge` and confirm whether it is `1.4.2` or older.
- Search the code for `forge.tls` or `tls.createConnection` used as a client, and check whether `connection.process()` is called inside a socket `data` handler without a try/catch.

## Fix

- node-forge: move to `1.4.3`.

## Timeline

- 2026-11-10T19:25:15+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-125334
- 2026-11-10T21:17:48+00:00 ghsa https://github.com/advisories/GHSA-j8rw-jp99-435v

## Documents

- [advisory] Vendor advisory: github.com https://github.com/digitalbazaar/forge/security/advisories/GHSA-j8rw-jp99-435v
- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/digitalbazaar/forge/security-advisories/GHSA-j8rw-jp99-435v
- [fix] Patch: github.com https://github.com/digitalbazaar/forge/commit/2cfaeb516cb3d4aff1c0569d39394df41c5cb17c
- [fix] Release notes: github.com https://github.com/digitalbazaar/forge/releases/tag/v1.4.3
- [fix] Patch: github.com https://github.com/digitalbazaar/forge/pull/1169

## From the sources

### 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
- RFC 5246, section 7.2.1 (Closure Alerts): https://www.rfc-editor.org/rfc/rfc5246#section-7.2.1
- Related: GHSA-525v-9gp9-w22h (another TLS client `TypeError`, fixed in 1.4.1): https://github.com/digitalbazaar/forge/security/advisories/GHSA-525v-9gp9-w22h

#### 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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
