Skip to main content
Menu
Advisories

SD-JWT VC Key Binding JWT audience is not bound to the verifier unless the optional audience option is passed

GHSA-3V3J-FGHH-R2GGPublished Updated GitHub

Description

Impact

When verifying an SD-JWT VC presentation, @openeudi/openid4vp checks the Key Binding JWT (KB-JWT) aud claim only if the caller passes the optional audience option. verifyAuthorizationResponse accepts clientId, but before this fix it used clientId only to build the mdoc SessionTranscript, never as the KB-JWT audience. The README examples do not set audience.

When audience is not set, the library accepts:

  • a KB-JWT with no aud;
  • a KB-JWT whose aud names a different verifier.

This allows a presentation relay (cross-verifier replay):

  1. A malicious verifier M obtains an honest verifier V's nonce.
  2. M sends that nonce in its own request. The wallet shows "M" to the user, and the user consents.
  3. M forwards the resulting presentation to V. V accepts it, so M impersonates the holder at V.

This violates:

  • OpenID4VP 1.0 B.3.6: the aud claim MUST be the Client Identifier;
  • OpenID4VP 1.0 §14.1.2;
  • RFC 9901 §7.3 step 5f.

Not affected: integrations that already pass audience equal to their client identifier.

Patches

Fixed in 0.14.0:

  • verifyAuthorizationResponse uses options.clientId as the audience when audience is not set.
  • Verifying a KB-JWT with no audience available throws the new MissingAudienceError.
  • When an audience is configured, a KB-JWT with a missing aud is invalid.
  • aud must be a single string equal to the audience.

0.14.0 also enforces the KB-JWT typ (kb+jwt) and an iat freshness window (kbJwtMaxAge, default 300 s).

Workarounds

Always pass audience set to your verifier's client_id (including its prefix, for example x509_hash:...) to verifyAuthorizationResponse, verifyPresentation or the parser options.

References

Affected versions

References

GitHub · openeudi/openid4vp