Skip to main content
Vulnerability Database/CVE-2025-10939

CVE-2025-10939: Keycloak Privilege Escalation Vulnerability

CVE-2025-10939 is a privilege escalation vulnerability in Keycloak affecting proxy configurations like HAProxy. Attackers can bypass path restrictions using non-normalized paths to access admin endpoints. This article covers technical details, affected versions, security impact, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-10939 Overview

CVE-2025-10939 is a path handling flaw in Keycloak that can expose the /admin application path when the installation sits behind a reverse proxy. Keycloak documentation recommends restricting external access to /admin, leaving /realms publicly reachable. The vulnerability stems from how HAProxy and similar proxies handle relative or non-normalized URL paths. An attacker can craft a request against the exposed /realms endpoint that resolves to /admin after path traversal, bypassing the proxy-level restriction. Red Hat tracks this as a low-severity information exposure issue affecting Red Hat build of Keycloak.

Critical Impact

Remote unauthenticated attackers can reach the /admin application path on Keycloak deployments protected only by a proxy-based filter, exposing admin console endpoints that were assumed to be inaccessible from the internet.

Affected Products

  • Red Hat build of Keycloak
  • Red Hat Single Sign-On installations fronted by HAProxy (and comparable proxies)
  • Upstream Keycloak deployments relying on proxy path filtering for /admin

Discovery Timeline

  • 2025-10-28 - CVE-2025-10939 published to the National Vulnerability Database
  • 2025-10-28 - Red Hat issues advisories RHSA-2025:21370 and RHSA-2025:21371
  • 2026-10-18 - Last updated in NVD database

Technical Details for CVE-2025-10939

Vulnerability Analysis

Keycloak exposes two primary HTTP path trees: /realms for end-user authentication flows and /admin for the administrative console and REST API. Operators are instructed to publish only /realms through the external proxy. The flaw occurs when the proxy forwards relative or non-normalized paths to the backend without canonicalizing them first. A request such as /realms/../admin/... traverses out of the allowed prefix once Keycloak resolves the path. This is classified under [CWE-427] Uncontrolled Search Path Element in the NVD record, though the practical behavior is a path normalization inconsistency between the proxy and the application.

Root Cause

The root cause is a mismatch in path normalization between HAProxy and the Keycloak application. HAProxy evaluates ACLs against the raw request path. Keycloak's routing layer normalizes .. segments after the proxy decision has already been made. The proxy therefore permits a URL it considers to be inside /realms, while the backend serves it from /admin.

Attack Vector

Exploitation requires network access to the proxy's public listener and does not require authentication or user interaction. An attacker crafts a URL that embeds relative path segments to escape the /realms prefix and reach /admin resources. The CVSS vector reports high attack complexity, reflecting that the attacker must identify specific endpoints and proxy behaviors. Successful requests disclose administrative resources but do not directly grant integrity or availability impact without further exploitation.

No verified public exploit code is available. See the GitHub Keycloak Issue #43763 and GitHub Keycloak Pull Request #43765 for upstream technical discussion and the applied fix.

Detection Methods for CVE-2025-10939

Indicators of Compromise

  • HTTP access logs containing .., %2e%2e, or other encoded traversal sequences in request paths targeting /realms
  • Backend requests to /admin/* endpoints originating from proxy forwards that did not pass through the console-facing listener
  • Unexpected GET or POST requests to Keycloak admin REST paths such as /admin/realms from untrusted source IPs

Detection Strategies

  • Compare request paths at the proxy against the normalized paths processed by Keycloak and alert on divergence
  • Enable Keycloak audit logging for administrative endpoints and route logs into a SIEM for correlation
  • Deploy web application firewall rules that reject path traversal patterns before they reach the proxy backend

Monitoring Recommendations

  • Monitor HAProxy and Keycloak access logs for traversal patterns and 2xx responses on /admin from external networks
  • Track administrative API usage baselines and alert on unexpected unauthenticated requests to admin paths
  • Review proxy ACL hit counters to confirm the /admin deny rules are matching traffic as expected

How to Mitigate CVE-2025-10939

Immediate Actions Required

  • Apply the fixes delivered in RHSA-2025:21370 and RHSA-2025:21371 to Red Hat build of Keycloak installations
  • Audit proxy configurations to ensure both raw and normalized paths are evaluated before forwarding
  • Restrict network access to the Keycloak admin console using segmentation or VPN, not only proxy ACLs

Patch Information

Red Hat published advisories RHSA-2025:21370 and RHSA-2025:21371 with corrected packages. The upstream fix is tracked in GitHub Keycloak Pull Request #43765. Additional vendor context is available in the Red Hat CVE Report CVE-2025-10939 and Red Hat Bugzilla Report #2398025.

Workarounds

  • Configure HAProxy to normalize request paths before ACL evaluation using the http-request normalize-uri path-merge-slashes path-strip-dotdot directive on supported versions
  • Reject any request containing .., %2e%2e, or backslash sequences at the proxy before it reaches Keycloak
  • Bind the Keycloak admin interface to a separate hostname or port that is not published through the public proxy
bash
# HAProxy frontend hardening example
frontend keycloak_public
    bind *:443 ssl crt /etc/haproxy/certs/keycloak.pem
    http-request normalize-uri path-merge-slashes
    http-request normalize-uri path-strip-dotdot
    http-request deny if { path_beg /admin }
    http-request deny if { path -m reg (\.\.|%2e%2e) }
    default_backend keycloak_backend

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.