{"id":"CVE-2026-125334","aliases":["CVE-2026-125334","GHSA-j8rw-jp99-435v"],"related":[],"kind":"vulnerability","state":"published","title":"Forge: TLS client crash on a handshake record received without a session","summary":"Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.3, a forge.tls client can pass a handshake record to tls.handleHandshake() while the connection has no session, including after a close_notify alert, after the application calls close(), or before handshake() is called. The handler dereferences c.session.md5 before dispatching the message, causing a TypeError to propagate from connection.process(). A malicious server or on-path attacker can deliver the record, including after a reset when the connection uses no encryption, and terminate a Node.js process if the application does not catch the exception. forge.tls servers are not affected, and there is no confidentiality or integrity impact. This issue is fixed in version 1.4.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Forge (also called node-forge) is a native implementation of Transport Layer Security in JavaScript. Prior to 1.4.3, a forge.tls client can pass a handshake record to tls.handleHandshake() while the connection has no session, including after a close_notify alert, after the application calls close(), or before handshake() is called. The handler dereferences c.session.md5 before dispatching the message, causing a TypeError to propagate from connection.process(). A malicious server or on-path attacker can deliver the record, including after a reset when the connection uses no encryption, and terminate a Node.js process if the application does not catch the exception. forge.tls servers are not affected, and there is no confidentiality or integrity impact. This issue is fixed in version 1.4.3.","source":"cvelist"},{"lang":"en","text":"### Summary\nA `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.\n\n### Details\n`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')`.\n\nThis happens:\n- after the server sends a `close_notify` alert (at any alert level);\n- after the application calls `close()`;\n- before the application calls `handshake()`.\n\nThe 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.\n\nServers are not affected: a server creates its session when it receives a ClientHello.\n\nThe fix handles these records like other unexpected records on a closed client: they are ignored.\n\n#### Patches\nFixed in node-forge 1.4.3.\n\n#### Workarounds\nCatch 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.\n\n#### Resources\n- RFC 5246, section 7.2.1 (Closure Alerts): https://www.rfc-editor.org/rfc/rfc5246#section-7.2.1\n- 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\n\n#### Severity\nCVSS 3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H (5.9, Moderate)\nCVSS 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)\nCVSS 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.\n\n#### Credits\nReported by @manus-use.\n\n### Proof of concept\n    var c = forge.tls.createConnection({server: false, ...});\n    c.handshake();\n    // warning close_notify alert, then an empty ServerHello, in separate\n    // process() calls\n    c.process(forge.util.hexToBytes('15030100020100'));\n    c.process(forge.util.hexToBytes('160301000402000000'));\n    // <= 1.4.2: TypeError: Cannot read properties of null (reading 'md5')\n    // 1.4.3: the record is ignored\n\nThe reporter's PoC is in tests/pocs/ghsa-j8rw-jp99-435v.js, and regression tests are in tests/unit/tls.js.\n\n### Impact\nApplications 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.","format":"markdown","source":"ghsa"}],"published":"2026-11-10T18:49:55.508Z","modified":"2026-11-16T15:47:21.053Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"version":"< 1.4.3","status":"affected"}],"vendor":"digitalbazaar","product":"forge","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.4.3"}],"ecosystem":"npm","package":"node-forge","purl":"pkg:npm/node-forge","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.4.3"}],"vendor":"digitalbazaar","product":"forge","cpe":"cpe:2.3:a:digitalbazaar:forge:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/digitalbazaar/forge/security/advisories/GHSA-j8rw-jp99-435v","tags":["exploit","mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/digitalbazaar/forge/pull/1169","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/digitalbazaar/forge/commit/2cfaeb516cb3d4aff1c0569d39394df41c5cb17c","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/digitalbazaar/forge/releases/tag/v1.4.3","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/digitalbazaar/forge","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-11-14T03:00:46.590Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-125334","url":"https://www.cve.org/CVERecord?id=CVE-2026-125334","licence":"CVE Terms of Use","modified":"2026-11-14T03:01:09.437Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j8rw-jp99-435v","url":"https://github.com/advisories/GHSA-j8rw-jp99-435v","licence":"CC-BY-4.0","modified":"2026-11-10T21:30:04.008Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-125334","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-125334","licence":"Public domain","modified":"2026-11-16T15:47:21.053Z"}],"updatedAt":"2026-11-25T22:59:50.088Z","epss":{"score":0.00336,"percentile":0.28954,"date":"2026-12-01T12:00:22.000Z"}}