Skip to content

DockerEndpoint does not validate invalidRequestMessage after parsing authorization request #49009

Description

@abstractj

Description

DockerEndpoint.build() calls AuthorizationEndpointRequestParserProcessor.parseRequest() but does not check authRequest.getInvalidRequestMessage() before proceeding. This means malformed requests (e.g., duplicate query parameters like scope) are accepted and processed instead of being rejected.

In contrast, the OIDC authorization endpoint correctly validates this via AuthorizationEndpointChecker.checkInvalidRequestMessage() after parseRequest(), which rejects requests where getInvalidRequestMessage() is non-null.

Steps to reproduce

  1. Configure a Docker V2 client with request.object.required set to request_uri only
  2. Send a request to the Docker auth endpoint with a single scope parameter -- observe it is blocked (400) as expected
  3. Send a request with a duplicated scope parameter -- observe it succeeds (200) and returns a Docker token, bypassing the policy

Expected behavior

The Docker endpoint should reject requests with malformed/duplicate parameters, consistent with the OIDC endpoint behavior.

Actual behavior

The Docker endpoint accepts and processes the request because authRequest.getInvalidRequestMessage() is never checked after parseRequest().

Root cause

In DockerEndpoint.build() (DockerEndpoint.java), after calling parseRequest() the result of authRequest.getInvalidRequestMessage() is ignored. The OIDC path (AuthorizationEndpoint) correctly checks this at line 187 via checker.checkInvalidRequestMessage().

Fix

Add a check for authRequest.getInvalidRequestMessage() in DockerEndpoint.build() after the parseRequest() call, rejecting the request with a 400 if the message is non-null.


This issue was originally tracked in the private repository. Migrated by @abstractj.

Activity

  1. moved this from Backlog to In progress in Keycloak Roadmapon Sep 10, 2026
  2. added 20 commits that reference this issue on Sep 22, 2026
    86db0b4
    bb385f4
    989bd7a
    33f3ef3
    498d18e
    500f298
    94b77cb
    85f0877
    b0529e8
    1375fa5
    82bc5c9
    4050d84
    99199a4
    681c213
    cab7ce2
    28eb6e3
    d2c38e8
    f1b1cfa
    a57d316
    70b7f3c
  3. added a commit that references this issue on Oct 2, 2026
    8675aff
  4. added a commit that references this issue on Oct 2, 2026
    edb3370
  5. added a commit that references this issue on Oct 5, 2026
    b5546a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Fields

No fields configured for weakness.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions