[java-idp-oidc] 01/03: Explicitly check that the authorization request client_id matches with the pushed client_id

Codeberg noreply at shibboleth.net
Wed Nov 25 12:36:09 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-idp-oidc.

View the commit online:
https://codeberg.org/Shibboleth/java-idp-oidc/commit/40bd1e03f472ee00e7f587c5ebb382255b44fba4

commit 40bd1e03f472ee00e7f587c5ebb382255b44fba4
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Wed Nov 25 13:49:10 2026 +0200

    Explicitly check that the authorization request client_id matches with the pushed client_id
    
    The value from the pushed claims set was already previously used
---
 .../oauth2/profile/impl/SetRequestObjectToResponseContext.java   | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oauth2/profile/impl/SetRequestObjectToResponseContext.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oauth2/profile/impl/SetRequestObjectToResponseContext.java
index a7b70a66..21f5f3ef 100644
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oauth2/profile/impl/SetRequestObjectToResponseContext.java
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oauth2/profile/impl/SetRequestObjectToResponseContext.java
@@ -301,6 +301,15 @@ public class SetRequestObjectToResponseContext extends AbstractOAuthAuthorizatio
                         .map(ctx -> ctx.getClaimsSet())
                         .orElse(null);
             if (claimsSet != null && !claimsSet.isEmpty()) {
+                final Object claimsSetClientId = claimsSet.get("client_id");
+                final String requestClientId = authorizationRequest.getClientID().getValue();
+                if (!(claimsSetClientId instanceof String clientIdString) || !clientIdString.equals(requestClientId)) {
+                    log.warn("{} Authorization request client_id {} does not match with the pushed client_id {}",
+                            getLogPrefix(), requestClientId, claimsSetClientId);
+                    oidcResponseContext.setRequestObjectFailure(true);
+                    ActionSupport.buildEvent(profileRequestContext, OidcEventIds.INVALID_REQUEST_URI);
+                    return;
+                }
                 try {
                     final JWTClaimsSet jwtClaimsSet = JWTClaimsSet.parse(claimsSet);
                     oidcResponseContext.setRequestObject(new PlainJWT(jwtClaimsSet));

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list