/

CVE-2026-33896

Severity:

HIGH RISK

(7.4)

Improper Certificate Validation in node-forge

CVE-2026-33896

Modified

Vulnerability type

Category:

Improper Certificate Validation

CWE:

CWE-295

Impact:

TLS Certificate Chain Spoofing and Authentication Bypass

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

node-forge's pki.verifyCertificateChain() API fails to correctly enforce RFC 5280 basicConstraints requirements when an intermediate certificate omits both basicConstraints and keyUsage extensions.

In this situation, any leaf certificate without these extensions can be treated as a Certification Authority (CA) and used to sign other certificates that node-forge will incorrectly accept as valid, enabling certificate chain spoofing and man-in-the-middle style attacks in applications that rely on this validation.

Affected context

This vulnerability affects JavaScript/Node.js applications that use node-forge's pki.verifyCertificateChain() as a primary mechanism for validating X.509 certificate chains.

It becomes relevant where:

  • Applications accept or construct chains including intermediate certificates that may lack both basicConstraints and keyUsage extensions.
  • node-forge's validation result is trusted for establishing TLS-like trust, verifying peers, or authorizing connections.
  • The application does not perform additional RFC 5280-compliant checks on CA capabilities or certificate purposes.

Exploit preconditions

  • Attack surface: Any code path where untrusted or semi-trusted X.509 certificates are validated using pki.verifyCertificateChain(), such as custom TLS implementations, secure APIs, or internal PKI tooling built on node-forge.
  • Required access: Ability to supply or influence certificate chains (e.g., as a client certificate, server certificate, or a user-uploaded certificate bundle).
  • Trigger point: Validation of a certificate chain that includes:
  • An intermediate certificate missing both basicConstraints and keyUsage, and
  • A "leaf" certificate (also without these extensions) that the attacker uses as a de facto CA to sign additional certificates.
  • Why exploitation is possible: node-forge does not enforce the requirement that only certificates explicitly marked as CA (via basicConstraints, and often constrained via keyUsage) can sign other certificates. As a result, a non-CA certificate can be misinterpreted as a valid issuer.

Why this happens

The core issue is an incomplete implementation of RFC 5280 certificate validation logic in pki.verifyCertificateChain(). Specifically, the function fails to:

  • Require basicConstraints on intermediate certificates, and
  • Enforce that only certificates explicitly marked as CAs are permitted to issue other certificates.

When both basicConstraints and keyUsage are absent on an intermediate certificate, node-forge does not apply the necessary restrictions and effectively treats any such certificate as capable of acting as a CA.

This maps to CWE-295: Improper Certificate Validation, where security decisions are made based on certificate chains that are not validated according to protocol rules, allowing improper trust relationships and impersonation.

Potential impact

  • Attackers could create custom "leaf" certificates and use them as unauthorized CAs to sign arbitrary certificates that node-forge-based validation will accept.
  • Man-in-the-middle (MITM) attacks may be possible against applications that rely solely on node-forge for certificate chain verification.
  • Impersonation of trusted services or peers within systems that use node-forge for mutual TLS-like verification.
  • Unauthorized access to data or services that depend on certificate-based authentication or authorization.
  • Degradation of the overall trust model in internal PKI or custom cryptographic protocols built on node-forge.

General mitigation guidance

Mitigation generally focuses on enforcing proper certificate validation semantics and reducing blind trust in library defaults:

  • Apply strict RFC 5280 checks in your validation layer, ensuring that only certificates with basicConstraints.ca = TRUE (and appropriate keyUsage such as keyCertSign) are treated as CAs.
  • Treat certificates that lack basicConstraints and keyUsage as leaf-only, not capable of issuing other certificates.
  • Introduce explicit policy checks on acceptable issuers (e.g., whitelisting trusted roots, constraining intermediates, and enforcing name constraints where applicable).
  • Implement defense-in-depth around certificate-based authentication, combining certificate checks with additional identity verification when feasible.
  • Use least-privilege principles for trust anchors: minimize the number and scope of certificates that are allowed to issue others.

How teams detect issues like this

Potential detection approaches include:

  • Static analysis and code review:
  • Identify all uses of pki.verifyCertificateChain() in the codebase.
  • Verify whether additional checks on basicConstraints and keyUsage are performed after node-forge validation.
  • Flag custom certificate parsing/validation logic that assumes any successfully verified chain implies that intermediates are valid CAs.
  • Security testing and fuzzing:
  • Construct test chains where intermediates lack basicConstraints and keyUsage, and confirm whether the application accepts improperly issued certificates.
  • Include malformed or policy-violating certificate chains in integration tests.
  • Policy and tooling:
  • Use automated review tools or pre-commit hooks to surface direct use of cryptographic validation APIs without surrounding policy enforcement.
  • Maintain security guidelines for developers on correct certificate handling and reference them during design reviews of cryptographic features.

Sources

SourceLink
github.comgithub.com/digitalbazaar/forge/commit/2e492832fb25227e6b647cbe1ac981c123171e90
github.comgithub.com/digitalbazaar/forge/security/advisories/GHSA-2328-f5f3-gj25
access.redhat.comaccess.redhat.com/errata/RHSA-2026:13826
access.redhat.comaccess.redhat.com/errata/RHSA-2026:24761
access.redhat.comaccess.redhat.com/errata/RHSA-2026:34342
access.redhat.comaccess.redhat.com/errata/RHSA-2026:9742
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-33896
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2452458
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33896.json

Frequently asked

questions

Exploitability depends on how heavily your application relies on node-forge for certificate validation. If attackers can supply certificate chains and your application accepts node-forge's validation as sufficient to establish identity or trust, the vulnerability can be meaningfully exploited to bypass authentication or impersonate entities.

Not necessarily. The main requirement is the ability to present or influence certificate chains processed with pki.verifyCertificateChain(). This can occur over the network (e.g., as part of a protocol handshake) or through indirect means such as file uploads, configuration inputs, or integration with external PKI components.

Ensure that certificate validation enforces RFC 5280 rules for CA certificates: only certificates with appropriate basicConstraints and keyUsage values should be allowed to issue or sign other certificates. Treat any certificate that lacks these extensions as a leaf and apply additional policy checks around trusted roots and intermediates.

Treat cryptographic validation logic as security-critical: review it carefully, cross-check behavior against relevant standards (like RFC 5280), and avoid assuming that a library's defaults are fully policy-compliant. Incorporate security-focused code review, automated tests using malformed certificate chains, and ongoing monitoring of cryptographic dependencies for validation-related issues.

Find out what's already
exploitable in your codebase.