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
keycloak-cve-2026-18963-hunt — Hunt for CVE-2026-18963 exploitation traces (Keycloak unauthenticated account takeover) in the Keycloak database | Kitploit
Tools/GitHubGitHub/kyos-public/keycloak-cve-2026-18963-hunt
Vulnerability AnalysisDigital ForensicsAuthenticationIncident ResponseDatabase SecurityLog Analysis
GitHubkyos-public/keycloak-cve-2026-18963-hunt

keycloak-cve-2026-18963-hunt

Hunt for CVE-2026-18963 exploitation traces (Keycloak unauthenticated account takeover) in the Keycloak database

View Repository
914h 37m 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-18963: Keycloak account takeover, exploitation trace hunt

A psql script that searches a Keycloak PostgreSQL database for traces of CVE-2026-18963 exploitation (unauthenticated account takeover through the reset-credentials flow).

Published by KYOS. We wrote it while patching the Keycloak deployments we operate, to verify that nobody had been taken over during the exposure window.

The vulnerability

CVE-2026-18963 is a flaw in the reset-credentials flow of keycloak-services (keycloak#51833). An unauthenticated attacker can complete the password reset process for any user without clicking the mail verification link, then set a new password on the account. No user interaction is required.

Severity: Critical, CVSS v3.1 9.1 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N), per Red Hat and NVD. Root cause is improper state validation in the authentication flow, fixed in keycloak#51844.

Affected / fixed versions

StreamFixed in
26.7.x26.7.2 (release notes)
26.6.x26.6.6
26.4.x (LTS)26.4.15
26.826.8.0

Everything below those versions in the supported streams is vulnerable. Out-of-support releases (26.5.x, 26.3 and older) get no fix: assume exposure and upgrade to a fixed stream. Red Hat lists legacy RH-SSO 7 as not affected; the Red Hat Build of Keycloak 26.4/26.6 is fixed in 26.4.15-1 / 26.6.6-1.

Workaround if you cannot patch immediately

Disabling self-service password reset removes the vulnerable entry point: Admin console > Realm settings > Login > "Forgot password" off, for every realm. Via the admin API: PUT /admin/realms/{realm} with {"resetPasswordAllowed": false}.

This blocks the login-actions/reset-credentials endpoint but also prevents legitimate users from resetting their own password, so treat it as a stopgap until you upgrade. Note that Red Hat does not list an endorsed mitigation for this CVE; patching is the only real fix.

What the script checks

cve-2026-18963-keycloak-hunt.sql runs four read-only queries:

QueryWhat it finds
Q0Whether the realm stores login/admin events at all, and their TTL. If events are off or expired, empty results in Q2/Q3 prove nothing.
Q1Every password credential set inside the exposure window (credential.created_date). This is the takeover itself and works even if event logging was off.
Q2Reset/credential login events, flagging any completed reset with no SEND_RESET_PASSWORD in the prior 24h (no_email_before = t). That flag is the CVE signature: the attacker never triggered the mail.
Q3Admin-API credential resets and execute-actions operations, to rule out the admin-driven route.

Usage

root@kitploit:~
# defaults: realm 'master', window since 2026-06-01
psql -U keycloak -d keycloak -f cve-2026-18963-keycloak-hunt.sql

# explicit realm and window (run once per realm, quote values exactly like this)
psql -U keycloak -d keycloak \
  -v realm="'myrealm'" -v since="'2026-05-01'" \
  -f cve-2026-18963-keycloak-hunt.sql

Set since to just before your vulnerable version went live. On Kubernetes:

root@kitploit:~
kubectl exec -it my-postgres-pod -- \
  psql -U keycloak -d keycloak -v realm="'myrealm'" -v since="'2026-05-01'" \
  -f - < cve-2026-18963-keycloak-hunt.sql

Interpreting results

Rows in Q1 are not automatically compromises. Match each against a known legitimate cause (self-service reset, helpdesk action, new enrolment) and treat anything unexplained as a takeover candidate.

Q2 rows with no_email_before = t on RESET_PASSWORD, UPDATE_CREDENTIAL or UPDATE_PASSWORD are the strongest indicator of this CVE being exploited. Correlate the ip_address column with your access logs.

Check Q0 first: login events expire (events_expiration) and may be disabled entirely. Q1 does not expire, so it is the most reliable check.

If you find a takeover

  1. Disable the affected account or force a password reset through a trusted channel.
  2. Revoke the account's sessions and offline tokens (Admin console > Sessions) and rotate any secrets it could reach.
  3. Widen the investigation: reverse-proxy/ingress logs around the timestamps and IPs from Q2, actions performed by the account after the credential change, and downstream applications federated through Keycloak.

Caveats

  • Read-only, but prefer running it against a replica or a backup.
  • Written for Keycloak 26.x on PostgreSQL. Table names are stable across recent versions but verify on other databases or older versions.
  • No findings is not proof of no compromise (see Q0), especially with short event retention or logging disabled.

License

MIT, see LICENSE. Provided as-is, without warranty.

Download Tool