Bug 2450250 (CVE-2026-4634) - CVE-2026-4634 keycloak: Keycloak: Denial of Service via excessive processing of OpenID Connect scope parameters
Summary: CVE-2026-4634 keycloak: Keycloak: Denial of Service via excessive processing ...
Keywords:
Status: NEW
Alias: CVE-2026-4634
Deadline: 2026-04-15
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-03-23 08:41 UTC by OSIDB Bzimport
Modified: 2026-04-02 12:37 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-03-23 08:41:56 UTC
When receiving a POST request on the OpenID Connect token endpoint,
Keycloak fails to limit the passed-in scopes, which leads to a high
resource usage in Keycloak.

1. Generate a long list of scopes

```
SCOPE_5K=$(python3 -c "print(' '.join(['scope'+str for i in range(5000)]))")
echo "Scope parameter length: ${#SCOPE_5K} bytes"
```

2. Post a ROPC Grant:

```
time curl -s -o /dev/null -w "admin-cli 5K scopes: HTTP %{http_code}
(%{time_total}s)\n" \
-X POST "${KC_URL}/realms/master/protocol/openid-connect/token" \
-d "grant_type=password&client_id=admin-cli&username=x&password=x&scope=${SCOPE_5K}"
```

Root cause: TokenManager.getRequestedClientScopes() at line 658
performs String.contains() on the entire scope parameter string for
each default client scope, resulting in O(n²) processing time.

A single POST request with ~49KB of scope values causes 38.6 seconds
of server-side processing; with ~99KB it reaches 151.8 seconds

The same problem occurs for client credential grants and token
refreshes - in the case of token refreshes the problem occurs even
before checking the token, so any token can be used, allowing any
unauthenticated attacker to perform this.


Note You need to log in before you can comment on or make changes to this bug.