{"id":"CVE-2026-118778","aliases":["GHSA-525v-9gp9-w22h"],"title":"Forge: TLS client crash when the server sends no certificate","titleSource":"GitHub_M","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"### Summary\nThe forge TLS client's check for a missing server certificate read the wrong property and never ran. A malicious TLS server, or an on-path attacker who removes the server's Certificate message, can make `connection.process()` throw a `TypeError`, which crashes applications that use the forge TLS client. Fixed in node-forge 1.4.1.\n\n### Details\nAfter ServerHelloDone, `tls.handleServerHelloDone()` in `lib/tls.js` is meant to reject a server that sent no certificate with a fatal `insufficient_security` alert, after consulting the application's `verify` callback. The check tested `c.serverCertificate`, which is never set (the certificate is stored as `c.session.serverCertificate`), so it never ran. The client state machine allows ServerHelloDone directly after ServerHello, so the handshake continued to `tls.createClientKeyExchange()`, which reads `c.session.serverCertificate.publicKey` and throws a `TypeError` on the null certificate. The exception propagates out of `connection.process()` without calling the `verify` or `error` callbacks.\n\nThere is no authentication bypass: without a server certificate the client cannot build its RSA key exchange, so the handshake cannot complete.\n\nThe fix reads `c.session.serverCertificate` and always fails the handshake in that case, still calling `verify` so the application can customize the alert. Failing even when `verify` returns `true` is needed because the key exchange requires the certificate.\n\n#### Patches\nFixed in node-forge 1.4.1. The TLS client fails the handshake with an `insufficient_security` alert when the server sends no certificate.\n\n#### Workarounds\nCatch exceptions thrown by `connection.process()` in the code that feeds it network data, and close the connection when one occurs.\n\n#### Credits\nReported by @arpitjain099.\n\n### Proof of concept\nConnect a forge TLS client (`forge.tls.createConnection({server: false, ...})`) to a server whose first flight contains ServerHello and ServerHelloDone but no Certificate message. For example, run a forge TLS server and remove the Certificate handshake message (type 11) from its first flight before passing it to the client's `process()`.\n\nOn 1.4.0 the client's `process()` throws \"TypeError: Cannot read properties of null (reading 'publicKey')\", and the `verify` and `error` callbacks are not called. On 1.4.1 the client calls `verify` with `insufficient_security` and no certificates, calls `error` with \"No server certificate provided. Not enough security.\", sends a fatal alert and closes the connection.\n\nRegression tests are in tests/unit/tls.js (\"missing server certificate\").\n\n### Impact\nApplications that use the forge TLS client (`forge.tls.createConnection` with `server: false`) are affected. A malicious server the application connects to, or an on-path attacker who can modify the unauthenticated handshake, can make the client throw from `connection.process()`. Since `process()` is normally called from a socket data handler, the uncaught exception terminates a Node.js process. There is no confidentiality or integrity impact. Applications using Node.js's own TLS implementation are not affected.","severity":"medium","score":5.9,"published":"2026-10-29T18:44:09.502Z","modified":"2026-10-30T23:15:06.416Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"npm","name":"node-forge","sources":[{"name":"OSV · GHSA-525v-9gp9-w22h","url":"https://osv.dev/vulnerability/GHSA-525v-9gp9-w22h"}],"ranges":[{"events":[{"introduced":"0"},{"fixed":"1.4.1"}],"type":"SEMVER"}],"versions":[],"fixed":["1.4.1"]}],"sourceAffected":[],"references":["https://github.com/digitalbazaar/forge/security/advisories/GHSA-525v-9gp9-w22h","https://github.com/digitalbazaar/forge/commit/7be9fbd40df2e2f15f29fea2846b1c87d58f6888","https://github.com/digitalbazaar/forge/releases/tag/v1.4.1","https://nvd.nist.gov/vuln/detail/CVE-2026-118778","https://github.com/digitalbazaar/forge"],"sources":[{"name":"CVE","id":"CVE-2026-118778","modified":"2026-10-29T18:44:09.502Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-118778"},{"name":"OSV","id":"GHSA-525v-9gp9-w22h","modified":"2026-10-30T23:15:06.416126647Z","url":"https://osv.dev/vulnerability/GHSA-525v-9gp9-w22h"}],"assessments":[{"source":"GitHub_M","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9},{"source":"OSV","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9}],"cve":{"records":[{"id":"CVE-2026-118778","source":"GitHub_M","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-10-28T19:20:05.018Z","published":"2026-10-29T18:44:09.502Z","modified":"2026-10-29T18:44:09.502Z"}],"publishers":[{"name":"GitHub_M","role":"CNA","organizationId":"a0819718-46f1-4df5-94e2-005712e83aaa","modified":"2026-10-29T18:44:09.502Z"}],"references":[{"url":"https://github.com/digitalbazaar/forge/security/advisories/GHSA-525v-9gp9-w22h","tags":["x_refsource_CONFIRM"],"source":"GitHub_M"},{"url":"https://github.com/digitalbazaar/forge/commit/7be9fbd40df2e2f15f29fea2846b1c87d58f6888","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/digitalbazaar/forge/releases/tag/v1.4.1","tags":["x_refsource_MISC"],"source":"GitHub_M"}],"weaknesses":[{"id":"CWE-476","description":"CWE-476: NULL Pointer Dereference","source":"GitHub_M"}],"applicability":[],"prioritization":[]},"products":[{"vendor":"digitalbazaar","name":"forge","platforms":[],"versions":[{"version":"< 1.4.1","status":"affected"}],"cpes":[],"source":"GitHub_M","url":"https://www.cve.org/CVERecord?id=CVE-2026-118778"}],"remediation":[],"observedAt":"2026-10-30T23:32:39.101Z","kev":{"status":"not-listed","checkedAt":"2026-10-31T03:00:34.533Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-10-29T20:05:37.507Z","attemptedAt":"2026-10-29T20:05:37.507Z"},{"source":"GHSA","status":"no-result","checkedAt":"2026-10-29T20:05:37.624Z","attemptedAt":"2026-10-29T20:05:37.624Z"},{"source":"EUVD","status":"available","checkedAt":"2026-10-29T20:05:37.508Z","attemptedAt":"2026-10-29T20:05:37.508Z"},{"source":"EPSS","status":"no-result","checkedAt":"2026-10-29T20:05:38.629Z","attemptedAt":"2026-10-29T20:05:38.629Z"}],"evidence":[{"source":"NVD","id":"CVE-2026-118778","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-118778","modified":"2026-10-29T19:17:20.420","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","checkedAt":"2026-10-29T20:05:37.507Z"},{"source":"ENISA EUVD","id":"EUVD-2026-113336","url":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-113336","modified":"Oct 29, 2026, 6:44:09 PM","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","checkedAt":"2026-10-29T20:05:37.508Z"}],"aiSummary":{"text":"The forge TLS client in node-forge versions before 1.4.1 crashes when a malicious server or on-path attacker removes the server's Certificate message, causing a TypeError. The client fails to check for a missing server certificate, allowing the handshake to continue and throw an exception. This affects applications using the forge TLS client.","model":"@cf/meta/llama-3.3-70b-instruct-fp8-fast","generatedAt":"2026-10-31T00:06:07.734Z","sources":[{"name":"CVE","url":"https://www.cve.org/CVERecord?id=CVE-2026-118778"},{"name":"OSV","url":"https://osv.dev/vulnerability/GHSA-525v-9gp9-w22h"}]}}