GHSA-4C2F-96CF-F5FC

Vulnerability from github – Published: 2026-11-19 20:35 – Updated: 2026-11-19 20:35
VLAI
Summary
OpenID4VP: X.509 chain validation accepts a forged certificate that reuses a trusted anchor's Subject DN without verifying its signature
Details

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. Thanks for the thorough report, the self-contained reproduction, and coordinated disclosure.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 0.8.0"
      },
      "package": {
        "ecosystem": "npm",
        "name": "@openeudi/openid4vp"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.8.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-75522"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-295",
      "CWE-347"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-19T20:35:57Z",
    "nvd_published_at": "2026-11-18T21:18:02Z",
    "severity": "HIGH"
  },
  "details": "## Summary\n\n`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\u0027s Subject DN was accepted as the chain terminus **with no signature verification** against the anchor\u0027s public key.\n\nAn attacker who mints a self-signed certificate and copies a trusted anchor\u0027s Subject DN string onto it can therefore have that certificate \u2014 and any credential signed with its private key \u2014 accepted as issued under a trusted authority.\n\n## Impact\n\nA 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.\n\nExploitable 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\u0027s metadata), so downstream callers see a trusted outcome.\n\n## Details\n\n`src/trust/ChainBuilder.ts`, `tryBuild()`:\n\n```js\nwhile (current.subject !== anchor.subject) { /* verify \u0026 climb */ }\n// loop exits when current.subject === anchor.subject\nreturn chain;  // returned WITHOUT verifying `current` against the anchor\n```\n\nThe signature-verified closure path (`if (!issuer)` -\u003e `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\u0027s, 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.\n\nSecondary 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\u0027s `trustedAuthorityIds` / provenance.\n\n## Proof of Concept\n\n```js\n// Attacker mints a self-signed cert reusing a trusted anchor\u0027s Subject DN.\nconst impostor = selfSigned({ subject: trustedAnchor.subject /* string */ });\n// Vulnerable: resolves to a valid chain [impostor] with no signature check.\nawait new ChainBuilder().build(impostor, [trustedAnchor]);\n```\n\n## Patch\n\n`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`.\n\n## Workarounds\n\nNone. Upgrade to `0.8.1`.\n\n## Credits\n\nReported by **Reza Shokri** \u2014 Quellkern e.U. (https://augenmass.tech), GitHub [@devdotbo](https://github.com/devdotbo). Thanks for the thorough report, the self-contained reproduction, and coordinated disclosure.",
  "id": "GHSA-4c2f-96cf-f5fc",
  "modified": "2026-11-19T20:35:57Z",
  "published": "2026-11-19T20:35:57Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/openeudi/openid4vp/security/advisories/GHSA-4c2f-96cf-f5fc"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-75522"
    },
    {
      "type": "WEB",
      "url": "https://github.com/openeudi/openid4vp/pull/25"
    },
    {
      "type": "WEB",
      "url": "https://github.com/openeudi/openid4vp/commit/a3ffd435aadd61aff1f75ec4b2e1a0f44ffabf16"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/openeudi/openid4vp"
    },
    {
      "type": "WEB",
      "url": "https://github.com/openeudi/openid4vp/releases/tag/v0.8.1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "OpenID4VP: X.509 chain validation accepts a forged certificate that reuses a trusted anchor\u0027s Subject DN without verifying its signature"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…