HIGH · CVSS 3.1 7.5 EPSS 0.2% · 7th percentile CWE-295CWE-347

CVE-2026-75522: OpenID4VP: X.509 chain validation accepts a forged certificate that reuses a trusted anchor's Subject DN without verifying its signature

Published 2026-11-19 · Updated 2026-11-19 · Also known as GHSA-4c2f-96cf-f5fc

Summary

The @openeudi/openid4vp library improperly validates X.509 certificate chains by relying on Subject Distinguished Name string equality instead of cryptographic signature verification. Developers using this library for identity or credential verification must upgrade immediately to avoid accepting forged credentials.

Who is affected

An attacker can impersonate a trusted issuer by minting a self-signed certificate that mimics a trusted anchor's Subject DN string. When processed by vulnerable versions of the library, the system incorrectly treats the forged certificate as part of a trusted chain. This compromises identity and age-verification systems that rely on the library to establish trust in mdoc or SD-JWT VC presentations.

Exploitability

The vulnerability is rated as High severity with a CVSS 3.1 score of 7.5, indicating it is remotely exploitable without authentication and requires low attack complexity. While the EPSS score of 0.002 suggests low current prevalence of exploitation, the lack of CISA KEV listing confirms no public record of active mass exploitation at this time.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
npm @openeudi/openid4vp >= 0, < 0.8.1 0.8.1 npm install @openeudi/[email protected]

CVSS 3.1 vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Attack vectorNetwork
Attack complexityLow
Privileges requiredNone
User interactionNone
ScopeUnchanged
ConfidentialityNone
IntegrityHigh
AvailabilityNone

FAQ

Does this vulnerability allow an attacker to read encrypted data?

The vulnerability primarily impacts the trust-anchor verification logic, allowing for forged credentials; it does not inherently provide access to encrypted traffic, though it permits identity impersonation.

Is there a workaround if I cannot upgrade immediately?

No, there are no documented workarounds. Upgrading to version 0.8.1 is the only supported method to resolve the security flaw.

How does the patch fix the issue?

The patch forces the system to verify cryptographic closure via signature verification or strict DER byte-identity of the anchor, preventing the acceptance of certificates based solely on DN string matching.

Original advisory description
## Summary `ChainBuilder` (the private RFC 5280 validator behind `TrustEvaluator` and the public credential-parsing API) terminated chain building on **Subject Distinguished Name string equality** rather than on cryptographic closure to a trust anchor. A certificate whose Subject DN string matched a trusted anchor's Subject DN was accepted as the chain terminus **with no signature verification** against the anchor's public key. An attacker who mints a self-signed certificate and copies a trusted anchor's Subject DN string onto it can therefore have that certificate - and any credential signed with its private key - accepted as issued under a trusted authority. ## Impact A relying party using `@openeudi/openid4vp` to verify OpenID4VP presentations (mdoc / SD-JWT VC) could be induced to accept a **forged credential as genuine**, defeating the trust-anchor model. In an eIDAS / EUDI age- or identity-verification deployment this permits impersonation of a trusted issuer. Exploitable through the public verification path: `TrustEvaluator.evaluate()` returns a successful result (and, due to a secondary fallback, attributes the forged leaf to a real anchor's metadata), so downstream callers see a trusted outcome. ## Details `src/trust/ChainBuilder.ts`, `tryBuild()`: ```js while (current.subject !== anchor.subject) { /* verify & climb */ } // loop exits when current.subject === anchor.subject return chain; // returned WITHOUT verifying `current` against the anchor ``` The signature-verified closure path (`if (!issuer)` -> `verifySignature(current, anchor)`) is correct, but the `while` guard provides a second, unverified exit: when a supplied certificate (the leaf, or an attacker-supplied intermediate) has a Subject DN string equal to the anchor's, the loop body never runs, no `verifySignature` call is made, and the chain is returned as valid. The per-certificate checks that do run (validity, algorithm, keyUsage) all operate on the attacker-controlled certificate and do not bind it to the anchor. Secondary contributing weakness (`src/trust/TrustEvaluator.ts`): the anchor selected for the result was matched by `serialNumber` and **fell back to `anchors[0]`** when no match was found, so the forged leaf was reported alongside a genuine anchor's `trustedAuthorityIds` / provenance. ## Proof of Concept ```js // Attacker mints a self-signed cert reusing a trusted anchor's Subject DN. const impostor = selfSigned({ subject: trustedAnchor.subject /* string */ }); // Vulnerable: resolves to a valid chain [impostor] with no signature check. await new ChainBuilder().build(impostor, [trustedAnchor]); ``` ## Patch `ChainBuilder.tryBuild()` now requires the terminating certificate to be **byte-identical to the trust anchor** (DER `rawData` comparison) when the loop exits on DN equality; otherwise it throws `CertificateChainError` with `reason: "signature"`. Cryptographic closure via `verifySignature(current, anchor)` remains the only other accepted termination. As defense-in-depth, `TrustEvaluator` now selects the terminating anchor by DER byte-identity and throws instead of silently falling back to the first candidate. Fixed in `0.8.1`. ## Workarounds None. Upgrade to `0.8.1`. ## Credits Reported by **Reza Shokri** - Quellkern e.U. (https://augenmass.tech), GitHub [@devdotbo](https://github.com/devdotbo). Thanks for the thorough report, the self-contained reproduction, and coordinated disclosure.

References

Source records: GHSA-4c2f-96cf-f5fc (OSV.dev) · EPSS by FIRST, 2026-11-21.