NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-119190: Forge: X.509 basicConstraints bypass in verifyCertificateChain() via deprecated extension OIDs 2.5.29.10 and 2.5.29.13

highCVSS 3.1 7.4GHSA-5x38-2vff-x55p

node-forge up to 1.4.0 can accept a certificate as a CA when it is not one. forge.pki.verifyCertificateChain() reads basicConstraints by name, and node-forge maps the deprecated OIDs 2.5.29.10 and 2.5.29.13 to that name. A forged extension with cA TRUE placed first overrides the real one. Fixed in node-forge 1.4.1.

Published Oct 30, 2026 · Analysis Oct 31, 2026

What an attacker can do

In lib/oids.js the deprecated OIDs 2.5.29.10 and 2.5.29.13 share the name basicConstraints with the real extension, 2.5.29.19. cert.getExtension() returns the first match by name, and chain verification used that lookup. A certificate with a deprecated-OID extension (cA TRUE) ahead of the genuine basicConstraints (cA FALSE) passes as a CA. The same trick hides a pathLenConstraint. A deprecated-OID extension alone also satisfies the basicConstraints-present check added for CVE-2026-33896.

The attacker needs a CA that your application trusts to issue such a certificate. That typically means a CA that copies extensions from certificate signing requests, for example openssl x509 -req -copy_extensions copy. If that CA adds a keyUsage extension without keyCertSign, node-forge rejects the chain. This is why the CVSS complexity is high.

With such a certificate, the holder can sign leaf certificates for any name and have pki.verifyCertificateChain() accept them. In forge's own TLS stack (forge.tls), that allows server or client impersonation and traffic interception.

Who is affected

The npm package node-forge, versions <= 1.4.0. Applications are affected if they call forge.pki.verifyCertificateChain() or use forge.tls peer verification. Check which version you have, including transitive copies:

npm ls node-forge

node-forge

Ecosystem
npm
Affected
<= 1.4.0
Fixed in
1.4.1
Check
npm ls node-forge

How to fix it

Upgrade to node-forge 1.4.1. Chain verification now looks up basicConstraints by OID 2.5.29.19 only.

npm install [email protected]

There is no workaround inside node-forge. If you cannot upgrade, pass an options.verify callback to pki.verifyCertificateChain() (or verify to forge.tls.createConnection()) that rejects chains where a non-leaf certificate lacks a 2.5.29.19 extension with cA TRUE, using cert.getExtension({id: '2.5.29.19'}). CA operators can stop copying unrecognized extensions from certificate requests.

How to tell if you were hit

Scan certificates your CAs issued for extensions with OID 2.5.29.10 or 2.5.29.13, which are deprecated and should not appear. Look for end-entity certificates that carry those OIDs ahead of 2.5.29.19 with cA FALSE. Check CA configuration for copy_extensions copy or copyall. Review issuance logs for requests containing unusual extensions. Use npm ls node-forge across your repositories and lockfiles to find vulnerable copies.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

node-forge parses certificate extensions with the deprecated OIDs 2.5.29.10 and 2.5.29.13 as basicConstraints, and forge.pki.verifyCertificateChain() used the first extension with that name. A certificate with a forged deprecated-OID extension (cA TRUE) before its genuine basicConstraints extension (cA FALSE) is accepted as a CA certificate, and the same technique can hide a pathLenConstraint. Fixed in node-forge 1.4.1.

Details

lib/oids.js maps the deprecated certificate extension OIDs 2.5.29.10 and 2.5.29.13 to the name basicConstraints, the same name as the RFC 5280 extension 2.5.29.19. certificateExtensionFromAsn1() in lib/x509.js decodes extensions by name, so these extensions are decoded into the same cA and pathLenConstraint fields. cert.getExtension() returns the first extension with a matching name, and pki.verifyCertificateChain() looked up basicConstraints by name.

As a result, a certificate that contains a 2.5.29.10 (or 2.5.29.13) extension with cA TRUE before its genuine basicConstraints extension with cA FALSE is accepted as a CA certificate. The same technique can hide a CA certificate's pathLenConstraint. A deprecated-OID extension on its own also satisfies the check added for GHSA-2328-f5f3-gj25 (CVE-2026-33896) that basicConstraints is present. RFC 5280 section 4.2.1.9 defines basicConstraints only as id-ce 19 (2.5.29.19), and the path validation checks in section 6.1.4 apply to that extension.

The fix makes chain verification look up basicConstraints by OID (cert.getExtension({id: '2.5.29.19'})). This covers both the cA and the pathLenConstraint checks. Certificate parsing, the OID table and cert.getExtension('basicConstraints') are unchanged.

Patches

Fixed in node-forge 1.4.1. Chain verification now uses only the basicConstraints extension with OID 2.5.29.19.

Workarounds

None in node-forge itself. Applications that pass an options.verify callback to pki.verifyCertificateChain() (or verify to forge.tls.createConnection()) can reject chains in which a non-leaf certificate has no 2.5.29.19 extension with cA TRUE, for example with cert.getExtension({id: '2.5.29.19'}). CA operators can avoid copying unrecognized extensions from certificate requests.

Credits

WorkOS Security Team· [[email protected]](mailto:[email protected]) (@nickcollisson-workos)

Proof of concept

Have a trusted CA issue an end-entity certificate whose extensions are, in this order: a 2.5.29.10 (or 2.5.29.13) extension with the value of a basicConstraints cA TRUE (DER 30 03 01 01 FF), then the CA's own 2.5.29.19 basicConstraints with cA FALSE, and no keyUsage. For example, openssl x509 -req -copy_extensions copy with an extensions file that sets basicConstraints = CA:FALSE copies the extension from the CSR and produces this order. Use that certificate's key to sign a leaf certificate for any name.

On node-forge <= 1.4.0, forge.pki.verifyCertificateChain(caStore, [leaf, eeCert]) accepts the chain, and eeCert.getExtension('basicConstraints') returns the 2.5.29.10 extension with cA true. The same certificate without the deprecated-OID extension is rejected ("Certificate basicConstraints indicates the certificate is not a CA."). A certificate with only the deprecated-OID extension is also accepted.

The fix adds regression tests in tests/unit/x509.js and the reporter's PoC as tests/pocs/ghsa-5x38-2vff-x55p.js.

Impact

Applications that verify certificate chains with forge.pki.verifyCertificateChain(), including TLS peer certificate verification in forge.tls, are affected.

Exploitation requires a CA trusted by the application to issue a certificate that contains the attacker-supplied deprecated-OID extension, typically a CA that copies extensions from certificate signing requests. For example, openssl x509 -req -copy_extensions copy (or copyall) with an extensions file that sets basicConstraints = CA:FALSE and no keyUsage produces such a certificate. If the issuing CA adds a keyUsage extension without keyCertSign, node-forge rejects the chain.

The holder of such a certificate can then issue certificates for any name that pki.verifyCertificateChain() accepts. In forge's own TLS stack this allows impersonating servers (or clients, where client certificates are verified) and intercepting traffic.

Questions

Is node-forge 1.4.0 affected by CVE-2026-119190?

Yes. All versions up to and including 1.4.0 are affected. The fix is in 1.4.1.

Can anyone exploit this with a self-made certificate?

No. A CA your application trusts must issue a certificate containing the deprecated-OID extension, which usually happens when the CA copies extensions from signing requests. A keyUsage without keyCertSign also blocks it.

Does this affect TLS connections made by Node's built-in tls module?

The advisory covers applications using forge.pki.verifyCertificateChain() and forge.tls. It does not describe Node's native TLS stack.

Is there a workaround besides upgrading?

Only in application code. Use an options.verify callback that rejects chains where a non-leaf certificate has no 2.5.29.19 extension with cA TRUE.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More npm vulnerabilities

All npm entries