8000 DockerEndpoint does not validate invalidRequestMessage after parsing authorization request · Issue #49009 · keycloak/keycloak · GitHub
[go: up one dir, main page]

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 dupl 10000 icated 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. added
    area/oidcOpenID Connect / OAuth 2.0 — tokens, endpoints, scopes, DCR, PAR, DPoP
    kind/bugCategorizes a PR related to a bug
    on May 14, 2026
  2. added theissue type on May 14, 2026
  3. changed the issue type fromtoon May 19, 2026
  4. 26 remaining items

  5. added 2 commits that reference this issue on Oct 1, 2026
    70b7f3c
    8675aff
  6. added a commit that references this issue on Oct 2, 2026
    edb3370
  7. 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

0