SD-JWT VC Key Binding JWT audience is not bound to the verifier unless the optional audience option is passed
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
audnames a different verifier.
This allows a presentation relay (cross-verifier replay):
- A malicious verifier M obtains an honest verifier V's
nonce. - M sends that nonce in its own request. The wallet shows "M" to the user, and the user consents.
- 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
audclaim 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:
verifyAuthorizationResponseusesoptions.clientIdas the audience whenaudienceis 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
audis invalid. audmust 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
- OpenID4VP 1.0, Appendix B.3.6 and §14.1.2: openid.net/
specs/ openid-4-verifiable-presentations-1_0.html - RFC 9901 §4.3 and §7.3: rfc-editor.org/
rfc/ rfc9901.html - Found during an internal specification-conformance audit, 2026-10-20.