Summary
OpenID4VP can accept a forged credential chain when an attacker-controlled certificate uses the same Subject Distinguished Name as a trusted anchor, without proving cryptographic linkage to that anchor. A remote unauthenticated attacker may use this behavior to make credentials signed with an attacker-controlled key appear to come from a trusted authority.
Affected context
The issue occurs in OpenID4VP's certificate chain construction and trust evaluation paths for SD-JWT VC and mDOC/mDL credentials. It becomes relevant when attacker-supplied certificates are evaluated against configured trust anchors and chain termination relies on matching a certificate's Subject Distinguished Name without confirming cryptographic closure to the anchor public key. Trust evaluation may further misattribute the chain through serial-number matching and fallback to the first anchor.
Exploit preconditions
- Attack surface: Credential parsing and trust evaluation in an application using OpenID4VP.
- Required access: No authentication is required; the attacker must be able to submit a credential and its certificate chain for evaluation.
- Trigger point: Chain construction and trust evaluation of the submitted credential.
- Why exploitation is possible: Chain construction can stop when an attacker-controlled certificate's Subject Distinguished Name matches a trusted anchor, without verifying that the chain cryptographically terminates at that anchor.
Why this happens
The chain builder treats equality of certificate Subject Distinguished Names as sufficient to terminate chain construction, rather than verifying cryptographic linkage to the trusted anchor's public key. This is an improper certificate validation pattern mapped to CWE-295: Improper Certificate Validation. The trust evaluator's serial-number match and fallback to the first anchor can also associate a forged chain with genuine authority metadata, reflecting insufficient verification of cryptographic trust relationships (CWE-347).
Potential impact
- Forged credentials may be accepted as issued by a trusted authority.
- Applications may make authorization or identity decisions based on untrusted credentials.
- Trust records or audit data may attribute an attacker-controlled chain to genuine authority metadata.
- Downstream systems relying on the evaluation result may accept falsified claims.
General mitigation guidance
Defensive patterns focus on establishing trust through cryptographic verification rather than certificate names or positional fallbacks.
- Verify each certificate's signature and issuer relationship through to the exact configured trust anchor.
- Fail closed when cryptographic chain closure or anchor identity cannot be established.
- Avoid selecting trust anchors through fallback behavior or insufficient identifiers such as serial numbers alone.
- Use strict, explicit trust-anchor configuration and minimize which authorities and credential types are accepted.
- Treat submitted credentials and certificate chains as untrusted, and limit the privileges of systems that consume their claims.
How teams detect issues like this
- Review chain-building logic for termination based solely on Subject Distinguished Name equality.
- Inspect trust evaluation paths for serial-number-only matching, positional anchor selection, or other ambiguous fallbacks.
- Use static analysis and code-review checks to identify certificate validation paths that do not verify signatures and issuer relationships through to a configured anchor.
- Enforce policy tests requiring cryptographic chain closure and fail-closed behavior for unrecognized or ambiguous chains.

