llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · @openeudi/openid4vp

GHSA-4C2F-96CF-F5FC

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

Parche disponible
Descargar PNG JSON
CVSS
—
high
Fuente: —
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versión0.8.1
Exposición9 hDesde la divulgación, 19 nov 2026, 3:35 p. m.
Detección21 minDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Monitoreo
Detectada +1
03:35 p. m.
12:42 a. m.
03:35 p. m.
05:52 p. m.
08:09 p. m.
10:25 p. m.
12:42 a. m.
FechaFaseEventoDetalle
Divulgación Publicada GHSA-4C2F-96CF-F5FC divulgada
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

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()`:

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

// 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.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Versiones

Rangos afectados

Afectada Corregida
@openeudi/openid4vp< 0.8.1
0.8.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npm@openeudi/openid4vp
Corregida 0.8.1 — —
Versiones corregidas0.8.1
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-75522
Otrahttps://github.com/openeudi/openid4vp/security/advisories/GHSA-4c2f-96cf-f5fc
Otrahttps://github.com/openeudi/openid4vp/pull/25
Otrahttps://github.com/openeudi/openid4vp/commit/a3ffd435aadd61aff1f75ec4b2e1a0f44ffabf16
Otrahttps://github.com/openeudi/openid4vp
Otrahttps://github.com/openeudi/openid4vp/releases/tag/v0.8.1

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.