Skip to content
NOUMENResearch
Network
Engineering
, home page

IntelligenceFindingsNMN-2026-0037

Forge: verifyCertificateChain() removes trusted CA certificates with the same subject from the CA store

CandidateMachine- or researcher-generated; not independently verified.

In short

What to know.

Package
node-forge npmnode-forge: before 1.4.1
What to do
Upgrade node-forge to 1.4.1 or later.
Severity
LowRated by the source advisory.
Confidence
HighThe affected range comes from the advisory; no system that uses the component has been assessed.

Verification

Where it stands.

  1. Candidate
  2. In review
  3. Reproduced
  4. Confirmed
  5. Resolved
  6. Disputed
  7. Withdrawn
Candidate Machine- or researcher-generated; not independently verified.

What each state means, and how a record moves between them.

6 listed

Sources

  1. OSV record GHSA-4487-j8r4-4g2fosv.devRetrieved 3 December 2026
  2. web reference for GHSA-4487-j8r4-4g2fgithub.comRetrieved 3 December 2026
  3. advisory reference for GHSA-4487-j8r4-4g2fnvd.nist.govRetrieved 3 December 2026
  4. web reference for GHSA-4487-j8r4-4g2fgithub.comRetrieved 3 December 2026
  5. package reference for GHSA-4487-j8r4-4g2fgithub.comRetrieved 3 December 2026
  6. web reference for GHSA-4487-j8r4-4g2fgithub.comRetrieved 3 December 2026

Full record

Finding
NMN-2026-0037
Category
vulnerability
Component
node-forge (npm)node-forge: before 1.4.1
Severity
Low. Rated by the source advisory.Severity as labelled by the source advisory GHSA-4487-j8r4-4g2f. CVSS as given: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L. Noumen has not assessed it.
Confidence
High.The affected range comes from the advisory; no system that uses the component has been assessed.
State
Candidate. Machine- or researcher-generated; not independently verified.
Disclosure
Public
Mitigation
Upgrade node-forge to 1.4.1 or later.
Discovery method
imported from a public advisory by the Advisory Monitor (1.0.0)Machine-generated by the agent advisory-monitor@1.0.0.
Reproduction
No reproduction steps recorded.
Affected systems
None listed. A link to a system needs its own evidence.
Attribution
Researcher: advisory-monitor@1.0.0 (agent, machine-generated)Validators: None yet
Assigned reviewer
Nobody yet
Dates
Created 3 December 2026, 16:48 UTCUpdated 3 December 2026, 16:48 UTC
Summary, as published by the source advisory
As published by the source advisory
### Summary When a CA store created by `pki.createCaStore()` holds two or more certificates with the same subject name, `pki.verifyCertificateChain()` permanently removes those certificates from the store while trying each one as the issuer. A peer can send any certificate that names that subject as its issuer to make all later verifications against those CA certificates fail. Fixed in node-forge 1.4.1. ### Details `pki.verifyCertificateChain()` (`lib/x509.js`) asks the CA store for the issuer of each certificate with `caStore.getIssuer()`. When the store holds several certificates with the same subject, `caStore.getIssuer()` returns the store's own internal array of those certificates (`caStore.certs[hash]`, built by `addCertificate()`). `verifyCertificateChain()` used that array directly as its list of candidate parents and called `parents.shift()` on it while trying each candidate. Every candidate it tried, including the one that finally verified the certificate, was removed from the store. Once the array is empty, `getIssuer()` returns an empty list, no candidate is tried, and verification fails with "Certificate signature is invalid." `hasCertificate()` and `listAllCertificates()` no longer see the removed certificates. The store stays in this state for as long as the object is used. The attacker's certificate only needs an issuer name equal to the shared subject name, which is public. Its signature and key can be arbitrary: every candidate is tried and shifted out because none verifies, and errors from `parent.verify()` are caught by the loop. Verification of the attacker's chain fails as expected. Verifying valid chains has a similar effect: the CA certificate that verified the chain and any tried before it are removed. No chain is accepted that should be rejected. Removing candidates can only turn a success into a failure. RFC 5280, Section 6.1.1(d) treats trust anchor information as an input to path validation. Validation should not consume it. The fix copies the array returned by `getIssuer()` before iterating over it, so the CA store is no longer modified. `getIssuer()` itself is unchanged. ### Patches Fixed in node-forge 1.4.1. `pki.verifyCertificateChain()` now works on a copy of the candidate issuer list instead of shifting entries out of the CA store. ### Workarounds - Pass a fresh CA store to each `pki.verifyCertificateChain()` call (for example `pki.createCaStore(trustedCerts)`), or pass `caStore` to `forge.tls.createConnection()` as an array of certificates instead of a store object, so that forge creates a new store per connection. - Or wrap the store so that `getIssuer()` returns a copy: var getIssuer = caStore.getIssuer; caStore.getIssuer = function(cert) { var r = getIssuer(cert); return Array.isArray(r) ? r.slice() : r; }; ### Proof of concept Two trusted self-signed CA certificates, `rootA` and `rootB`, share the subject `CN=Root`. `bogus` is any certificate whose issuer is `CN=Root`, signed with an unrelated key. `leafA` is a valid certificate issued by `rootA`. var caStore = forge.pki.createCaStore([rootA, rootB]); caStore.listAllCertificates().length; // 2 try { forge.pki.verifyCertificateChain(caStore, [bogus]); } catch(e) {} // rejected as expected ("Certificate signature is invalid.") caStore.listAllCertificates().length; // 0: both CA certificates are gone forge.pki.verifyCertificateChain(caStore, [leafA]); // throws "Certificate signature is invalid." (valid chain now rejected) Without the attacker certificate, verifying `leafA` twice against a fresh store gives the same result: the first call succeeds and removes `rootA`, the second fails. With the fix, the store keeps both certificates and every valid chain verifies. The regression tests are in `tests/unit/x509.js` ("CA store" section). ### Impact Applications that keep a long-lived CA store holding several trusted certificates with the same subject name, and that

1 event, oldest first

History

History verified: 1 eventLatest hashfb06d305e112fb06d305e11283f584bc5a4235bf0cce194d22443f667120469bd972d79c5c9e

  1. Record createdMachine-generated

    By advisory-monitor@1.0.0 (agent, machine-generated)

    Reason: Imported from public advisory GHSA-4487-j8r4-4g2f.

    Entered the record in the state Candidate.

    Event 1 hashfb06d305e112fb06d305e11283f584bc5a4235bf0cce194d22443f667120469bd972d79c5c9e
About this record

Severity and confidence are rated separately, each with its own reason.

History events are never edited or deleted. Each stores the hash of the one before, so a later change breaks the chain.

Corrections keep the value before and after.