Security

Keycloak CVE-2026-18963: Check and Patch the Password Reset Flaw

If your Keycloak realms show a “Forgot Password?” link on the sign-in page, CVE-2026-18963 lets someone with no account take over any user in those realms. The flaw sits in the reset-credentials flow. According to the upstream advisory, an unauthenticated attacker can force a password reset for any user without clicking the emailed verification link, then set new credentials and own the account. Keycloak rates it critical, CVSS 3.1 score 9.1.

Original content from computingforgeeks.com - post 192680

Red Hat shipped a patched build three months before the upstream advisory appeared, and that gap decides which version a community user should install. We built the lab on Ubuntu 26.04 in Google Cloud in November 2026, starting from vulnerable 26.6.4 and 26.4.7 containers, then upgraded through Docker Compose, the zip distribution and the Keycloak Operator. Every version string, event and log line below comes from that run, along with the per-realm stopgap Red Hat recommends when an upgrade has to wait and a table of the 16 other advisories published since 26.6.4.

Keycloak also needs the JVM fix, and the step-by-step Java4Shell patch guide for Keycloak covers it for Docker, ZIP and Operator installs.

The affected and fixed releases

Keycloak published GitHub advisory GHSA-6qm4-x97f-55fh (also served by the advisory API) on 19 November 2026 at 19:08 UTC. It lists org.keycloak:keycloak-services from 26.0.0 up to 26.4.15, from 26.5.0 up to 26.6.6 and from 26.7.0 up to 26.7.2 as affected, with 26.4.15, 26.6.6 and 26.7.2 as the patched versions. The catch is that only one of those three exists as a community release, so read the last column before you pick a tag.

What you runAffected by CVE-2026-18963What to install
Community Keycloak 26.0 to 26.6 (any patch)Yes26.8.2. No community 26.4.15 or 26.6.6 exists; the newest community builds are 26.4.7 and 26.6.4
Community Keycloak 26.7.0 or 26.7.1Yes26.8.2, or 26.7.2 at minimum (26.7.5 is the last 26.7 release)
Community Keycloak 26.7.2 to 26.7.5No, fixed26.8.2 for the later fixes
Community Keycloak 26.8.xNo, outside the rangeStay current, 26.8.2 at the time of writing
Red Hat build of Keycloak 26.4Yes26.4.15 (RHSA-2026:56519 containers, RHSA-2026:56520)
Red Hat build of Keycloak 26.6Yes26.6.6 (RHSA-2026:56524 containers, RHSA-2026:56523)
Red Hat Single Sign-On 7.6Yes, per Red Hatrh-sso7-keycloak 18.0.21 (RHSA-2026:99763 to 99767)
Community Keycloak 25 and olderNot listed upstream, but likely: Red Hat patched RH-SSO 7.6, which is based on Keycloak 18Unsupported; move to 26.8.2
CVE-2026-18963 status by Keycloak line, checked against the GHSA, the Red Hat CVE data and the quay.io tags on 20 November 2026

Exploitation data matters for how fast you move, and three live sources say it isn’t a fire drill yet, though the score says it should be treated as one.

  • EPSS: 0.08092 on 20 November 2026, the 94.9th percentile, from the FIRST EPSS API. That is a low absolute probability but higher than about 95% of scored CVEs.
  • CISA KEV: not listed in catalog version 2026.11.20, the latest in the CISA kev-data repository when we checked.
  • CISA SSVC on the NVD record: exploitation “none”, automatable “yes”, technical impact “total”. Automatable is the line to read: once a working request is public, scanning every Keycloak login page is cheap.

We found no public exploit code while writing this, and this post deliberately describes no request sequence. The wording of the advisory is enough to plan around. It needs no credentials and no user interaction, and it ends in full account control, so an exposed realm should be patched or mitigated today rather than in the next maintenance window.

Every Keycloak advisory since 26.6.4

CVE-2026-18963 is the loudest entry, but it is one of 17 advisories Keycloak has published since 26.6.4 shipped on 26 June 2026, and a server patched for this bug alone can still be open to the others. We pulled the full list from the Keycloak security advisories page and its API on 20 November 2026. Three of the June advisories deserve a closer look because each scores High and each lets a signed-in user or a client step past a control the operator thinks is enforced.

  • CVE-2026-11800, High 8.1, published 26 June 2026: JWT algorithm confusion in the JWT Authorization Grant flow lets a client with valid credentials forge assertions and impersonate any federated user of the affected identity provider. Affected below 26.6.4, fixed in 26.6.4. Realms that use JWT Authorization Grant with an external IdP are the ones to check first.
  • CVE-2026-9800, High 8.1, published 26 June 2026: the Policy Enforcer compares URIs incorrectly, so any authenticated user who puts the configured access-denied page path into a request bypasses role, scope and UMA checks. Fixed in server 26.6.4 and in the keycloak-policy-enforcer library 26.0.10. Java applications that embed the enforcer need the library update as well as the server one.
  • CVE-2026-9086, High 7.3, published 26 June 2026: a user with manage-client rights, or access to client registration, can register a redirect URI with a mixed-case javascript: or data: scheme and get script running in the Keycloak origin when a victim follows the link. Affected below 26.6.4, fixed in 26.6.4. Audit who holds manage-client and whether anonymous client registration is open.

The full list follows, newest first. The fixed versions are exactly as each advisory states them, and the last column says which community release carries the fix, because 26.4.14, 26.4.15, 26.6.5 and 26.6.6 are Red Hat build numbers that never appeared on quay.io.

AdvisoryIssueSeverityPublishedFixed in (advisory)Community fix
CVE-2026-18963Unauthenticated account takeover via reset-credentials flowCritical 9.12026-11-1926.4.15, 26.6.6, 26.7.226.7.2
CVE-2026-90997Replay protection bypass in stateless mode on MySQL or MariaDBHigh 7.42026-09-1626.7.4 (26.7.0 to 26.7.3 affected)26.7.4
CVE-2026-15573Authorization bypass via unnormalized URI matching in PathMatcherHigh 8.12026-08-0626.4.14, 26.6.5, 26.7.126.7.1
CVE-2026-15572DCR protocol mapper type swap bypasses policy, privilege escalationHigh 8.82026-08-0626.4.14, 26.6.5, 26.7.126.7.1
CVE-2026-16102Default DCR policy allows role forgery via user property mappersHigh 8.12026-08-0626.4.14, 26.6.5, 26.7.126.7.1
CVE-2026-16442SAML IdP-initiated broker login bypasses the link-only restrictionHigh 7.42026-08-0626.4.14, 26.6.5, 26.7.126.7.1
CVE-2026-16443SAML broker metadata import disables response signature validationHigh 7.42026-08-0626.4.14, 26.6.5, 26.7.126.7.1
CVE-2026-16100Unbounded metric cardinality in user event metricsMedium 6.52026-08-0626.6.5, 26.7.126.7.1
CVE-2026-16071LDAP entry DN user search escapes the configured users DNMedium 5.42026-08-0626.4.14, 26.6.5, 26.7.126.7.1
CVE-2026-11800Authentication bypass via JWT algorithm confusionHigh 8.12026-06-2626.6.426.6.4
CVE-2026-9800Policy Enforcer authorization bypass via incorrect URI comparisonHigh 8.12026-06-2626.6.4; policy enforcer library 26.0.1026.6.4
CVE-2026-9099Group admin escalation to realm adminHigh 7.72026-06-2626.6.426.6.4
CVE-2026-9086XSS via case-insensitive URI validation bypassHigh 7.32026-06-2626.6.426.6.4
CVE-2026-9795Privilege escalation via improper scope mapping enforcementHigh 7.32026-06-2626.6.426.6.4
CVE-2026-9705Disabled clients re-enabled via registration access tokenMedium 6.52026-06-2626.6.426.6.4
CVE-2026-9083Information disclosure through filesystem path probingMedium 4.92026-06-2626.6.426.6.4
CVE-2026-9799UMA permission ticket bypassMedium 4.62026-06-2626.6.426.6.4
Keycloak repository advisories published since 26.6.4, read from the GitHub advisory API on 20 November 2026

The advisory list is not the whole story, because Keycloak fixes many security issues before it files a GHSA for them. The 26.8.2 release notes list fixes for 33 CVE IDs, most with no repository advisory yet. Two of them undo earlier fixes in the table: CVE-2026-96457 is a regression of the CVE-2026-9099 group admin fix, and CVE-2026-97848 bypasses the CVE-2026-16102 fix. Others hit 26.8 itself, such as CVE-2026-110932 (unauthenticated disk exhaustion, “Keycloak <= 26.8.0”) and CVE-2026-112208 (account takeover, “reproduced on 26.8.1”). So 26.8.0 and 26.8.1 are not safe, even though no published advisory range includes them.

Reading both sources by branch gives the minimum version per line. Two advisories carry malformed ranges in the API (CVE-2026-16443 shows < 26.37.1 and CVE-2026-15573 shows < 26.7.0), so the table above uses their patched versions, which both read 26.7.1.

Branch you runMinimum safe on that branchWhat to do
Community 26.0 to 26.5None; no release on these lines carries the fixesUpgrade to 26.8.2
Community 26.6None; 26.6.4 clears the June advisories, but the August fixes and CVE-2026-18963 only exist as Red Hat 26.6.5 and 26.6.6Upgrade to 26.8.2
Community 26.7None; 26.7.5 clears every published advisory, but nothing shows the 26.8.2 fixes (CVE-2026-96457, CVE-2026-97848 and the rest) reaching 26.7, and the line gets no further releasesUpgrade to 26.8.2
Community 26.826.8.2; 26.8.0 and 26.8.1 miss the fixes in its release notesInstall 26.8.2
Red Hat build of Keycloak 26.426.4.15 for the August advisories and CVE-2026-18963. No 26.4.x is shown fixed for the June advisories by the GHSA ranges, which list only 26.6.4Install 26.4.15, then check the June CVEs and the 26.8.2 CVE IDs on the Red Hat CVE pages for your stream
Red Hat build of Keycloak 26.626.6.6 for every published advisoryInstall 26.6.6, then check CVE-2026-96457, CVE-2026-97848 and the other 26.8.2 CVE IDs on the Red Hat CVE pages
Java apps using keycloak-policy-enforcer26.0.10 (CVE-2026-9800)Update the library dependency and redeploy the app
Minimum safe Keycloak version per branch against the advisories published since 26.6.4

So the answer to “which Keycloak version is safe now” is community 26.8.2. It is the only community release at or above every fix in the advisory list and the only one carrying the 33 CVE fixes in its own release notes, and it is the version every upgrade path below lands on. On a Red Hat subscription, RHBK 26.6.6 clears every published advisory, but confirm the newer CVE IDs against the Red Hat errata before calling it done.

Why community 26.4 and 26.6 have no patch

Two of the patched numbers in the advisory, 26.4.15 and 26.6.6, are Red Hat build of Keycloak (RHBK) versions. The NVD record was published on 18 August 2026 by Red Hat as the CNA, and its description names the Red Hat build. The Red Hat CVE page and its JSON feed show a public date of 17 August, Critical severity, a root cause of improper state validation in the reset-credentials flow, and RHBK 26.4.15 and 26.6.6 shipping on 18 August. RH-SSO 7.6 followed on 12 November.

Upstream, the fix went out in community 26.7.2 on 19 August, whose release notes list issue 51833 “CVE-2026-18963 Unauthenticated account takeover via reset-credentials flow bypass”. The GHSA came three months later. Meanwhile the community 26.4 line stopped at 26.4.7 in December 2025 and 26.6 at 26.6.4 in June 2026. We checked quay.io directly: tags 26.4.15, 26.6.5 and 26.6.6 don’t exist, and keycloak-services on Maven Central stops at 26.4.7 and 26.6.4 too. In practice a community user on 26.0 to 26.6 has to cross a minor version to get the fix. We’d go straight to 26.8.2 rather than 26.7.2, because 26.7.3 and later carry other security fixes as well.

The version your server runs

Ask the running server, not the compose file or the Helm values, because a tag can drift from what’s actually deployed. Our lab ran Keycloak with PostgreSQL and Mailpit from a compose project in ~/keycloak. The first two commands need no login. The admin CLI needs a session, which the next command opens using the bootstrap admin password the container already holds in its environment. With a permanent admin account, put that user and its password there instead.

cd ~/keycloak
docker compose ps --format "table {{.Service}}\t{{.Image}}\t{{.Status}}"
docker compose exec keycloak /opt/keycloak/bin/kc.sh --version
docker compose exec keycloak sh -c '/opt/keycloak/bin/kcadm.sh config credentials --server http://localhost:8080 --realm master --user admin --password "$KC_BOOTSTRAP_ADMIN_PASSWORD" --config /tmp/kcadm.config'

With the session in place, the server reports its own version through the admin API, which is the answer an auditor will accept over a tag in a file.

docker compose exec keycloak /opt/keycloak/bin/kcadm.sh get serverinfo -r master --config /tmp/kcadm.config --fields 'systemInfo(version)'

All three agree on 26.6.4 here, which sits inside the 26.5.0 to 26.6.6 range, so this server is vulnerable. The realms listing at the bottom of the capture comes from the exposure check in the next section.

Keycloak 26.6.4 version check with kc.sh --version and kcadm.sh serverinfo, plus realms with resetPasswordAllowed

Startup logs carry the same answer, which helps when you only have log access through a SIEM or kubectl logs. Keycloak prints one line per start.

docker compose logs keycloak --no-log-prefix | grep "on JVM"

Our vulnerable server logged this at boot. The Quarkus version alongside it changes with every Keycloak minor, so match on the Keycloak number only.

2026-11-20 19:38:20,989 INFO  [io.quarkus] (main) Keycloak 26.6.4 on JVM (powered by Quarkus 3.33.2.1) started in 7.500s. Listening on: http://0.0.0.0:8080. Management interface listening on http://0.0.0.0:9000.

A 26.4.7 container we started beside it printed “Keycloak 26.4.7 on JVM (powered by Quarkus 3.27.1)”, the last community 26.4 build and still vulnerable. In the admin console the version sits on the welcome page of the master realm. Open the Server info tab and read the Version field.

Keycloak admin console Server info tab on the master realm showing version 26.6.4
  1. 1Server info
  2. 2Version

Fleets with several Keycloak deployments are better served by an image inventory than by logging in to each console. Two commands list every Keycloak container on a Docker host and every Keycloak pod in a cluster, including the RHBK image name.

docker ps --format '{{.Names}}\t{{.Image}}' | grep -i keycloak
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.spec.containers[*].image}{"\n"}{end}' | grep -E 'quay.io/keycloak/keycloak:|keycloak-rhel9'

Any tag below 26.7.2 on the community image, or an RHBK image older than rhbk/keycloak-rhel9:26.4-23 or 26.6-12 (the fixed images in the 18 August errata), goes on the patch list. The grep also catches the database and mail containers of a compose project named keycloak, so read the image column rather than the count. Custom images built FROM a Keycloak tag hide the upstream version behind your own name, so check those with kc.sh --version inside the container rather than by name.

Exposure through the Forgot password setting

Only realms that allow password resets ever run the vulnerable code. The switch is the Forgot password setting of each realm, stored as resetPasswordAllowed, and it’s off in a new realm. Teams turn it on for any realm that serves real users, because the alternative is a helpdesk ticket for every forgotten password. When it is on, the sign-in page shows the link.

Keycloak realm sign-in page showing the Forgot Password link that the reset-credentials flow starts from

Rather than clicking through every realm, list the setting for all of them in one call. In our lab only acme, the customer-facing realm, had it on:

docker compose exec keycloak /opt/keycloak/bin/kcadm.sh get realms --config /tmp/kcadm.config --fields realm,resetPasswordAllowed --format csv --noquotes

Each line is a realm name and its setting, so grep true on this output is a complete list of exposed realms on the server.

partners,false
acme,true
master,false

A realm showing true on an affected version is exposed. Realms set to false on the same server sit outside the path of this bug, which is why the Red Hat mitigation works at all, but they still share the vulnerable binary, so they do not change the upgrade decision. Realms created later, or imported from an export that has the setting on, need the same check.

A per-realm stopgap until the upgrade

Red Hat recommends one mitigation for when an immediate upgrade isn’t possible: turn Forgot password off in every realm. It costs you self-service resets, so users who forget a password need an admin until the patch lands. For a single realm in the console, select the realm, then follow the marks.

  1. Realm settings in the left menu.
  2. The Login tab.
  3. The Forgot password switch, set to Off. The console saves the change straight away.
Keycloak Realm settings Login tab with the Forgot password switch that turns off the reset-credentials flow
  1. 1Realm settings
  2. 2Login
  3. 3Forgot password

With more than a handful of realms, the admin CLI is faster and leaves a record. This loop reads every realm, keeps the ones with the setting on and switches each off. Before running it we had both acme and partners set to true, so the loop had two realms to change.

for r in $(docker compose exec -T keycloak /opt/keycloak/bin/kcadm.sh get realms --config /tmp/kcadm.config --fields realm,resetPasswordAllowed --format csv --noquotes | awk -F, '$2=="true"{print $1}'); do docker compose exec -T keycloak /opt/keycloak/bin/kcadm.sh update realms/$r --config /tmp/kcadm.config -s resetPasswordAllowed=false && echo "disabled Forgot password in $r"; done

Our capture lists the realms before and after the loop. Both changed realms went from enabled to disabled, and the master realm was never touched.

kcadm.sh loop turning off Forgot password in every Keycloak realm that had resetPasswordAllowed set to true

A setting is only as good as its effect, so we probed the endpoint itself. Before the change, the reset-credentials page in acme served the “Forgot Your Password?” form we used for the test reset in the events section. After it, the same URL answers with an error page and the sign-in page no longer carries the link.

curl -s "http://localhost:8080/realms/acme/login-actions/reset-credentials?client_id=account-console" | grep -oE 'Forgot Your Password\?|Reset Credential not allowed'
curl -s "http://localhost:8080/realms/acme/protocol/openid-connect/auth?client_id=account-console&response_type=code&redirect_uri=http://localhost:8080/realms/acme/account/" | grep -c 'kc-forgot-pw-link'

Now the first command finds only the refusal, and the link count on the sign-in page is zero.

Reset Credential not allowed
0

Run the same probe against your public hostname with each realm name and a real client ID. If a realm still serves the form, the setting is still on there (an import or a configuration pipeline can put it back), and that realm is still exposed.

Reset events worth auditing

Looking back for abuse depends on one setting many installs never touch: a realm stores user events only after Save events is switched on, so a realm without it has no record to search. Our acme realm had events on with 30 days of retention before any reset happened. We then ran one legitimate reset for a user and one for a username that doesn’t exist, and pulled the stored events by type.

for t in SEND_RESET_PASSWORD RESET_PASSWORD RESET_PASSWORD_ERROR UPDATE_PASSWORD; do docker compose exec keycloak /opt/keycloak/bin/kcadm.sh get events -r acme --config /tmp/kcadm.config -q type=$t --fields time,type,userId,ipAddress,error --format csv --noquotes; done

We loop per type because kcadm sends only the last -q type= when you give it several. Each row reads as time in epoch milliseconds, type, user ID, client IP and error.

1795203707622,SEND_RESET_PASSWORD,33cb4503-4312-4be6-b14c-a803d98754e8,172.18.0.1,
1795203789435,RESET_PASSWORD_ERROR,,172.18.0.1,user_not_found
1795203713062,UPDATE_PASSWORD,33cb4503-4312-4be6-b14c-a803d98754e8,172.18.0.1,

Two results surprised us, and both change what you should search for. First, a successful reset on 26.6.4 recorded no RESET_PASSWORD event at all, so a search on that type alone finds nothing. Second, the unknown username produced RESET_PASSWORD_ERROR with user_not_found. A legitimate reset left this trail instead:

  1. SEND_RESET_PASSWORD when the email went out.
  2. UPDATE_PASSWORD and UPDATE_CREDENTIAL when the new password was set.
  3. LOGIN and CODE_TO_TOKEN as the user signed back in.

The user events page in the console shows the same sequence for alice, newest first.

Keycloak realm user events after a legitimate password reset: SEND_RESET_PASSWORD, UPDATE_PASSWORD, UPDATE_CREDENTIAL, LOGIN and CODE_TO_TOKEN

Server logs hold less than the event store. The Server Administration Guide says Keycloak logs error events as WARN and other events as DEBUG, so with the default log level our grep found only the failed reset.

docker compose logs keycloak --no-log-prefix | grep -E 'type="?(SEND_RESET_PASSWORD|RESET_PASSWORD|UPDATE_PASSWORD)'

One WARN line came back, with the attempted username at the end. A SIEM rule on RESET_PASSWORD_ERROR is cheap to add, but it only sees failures, never a reset that worked.

2026-11-20 19:43:09,441 WARN  [org.keycloak.events] (executor-thread-15) type="RESET_PASSWORD_ERROR", realmId="6f7f484c-d8df-443b-b51d-8d8afcd92d4e", realmName="acme", clientId="account-console", userId="null", ipAddress="172.18.0.1", error="user_not_found", auth_method="openid-connect", auth_type="code", redirect_uri="http://localhost:18080/realms/acme/account", code_id="zkbOUmuvgHtWkD-2Drurn-0L", username="nobody"

On an exposed realm we would run the review from the event store rather than the log, in this order.

  • Every UPDATE_PASSWORD since the vulnerable version went live: each one is a password change, so match it to a ticket or ask the user whether they made it.
  • Bursts of RESET_PASSWORD_ERROR from one IP: user_not_found in volume means someone is enumerating usernames against the reset form.
  • Admin accounts first: a password change on a realm admin, or on any user with realm-management roles, is the takeover that hurts most.

If events were off, you cannot prove a negative. In that case, expire sessions for the realm after the upgrade and require a password change for privileged users, which costs one login each and removes any credentials set through the flaw.

Upgrading a Docker Compose deployment

A container deployment is patched by changing the image tag, and the database schema migrates on first start. That migration is one-way, so take a database dump first. If the new version misbehaves, the dump is your only route back to 26.6.4. Our compose file reads the image tag from KC_TAG in its .env file, sets KC_HEALTH_ENABLED=true and publishes the management port 9000 to the host. If your file hardcodes the tag, edit the image: line instead of running the sed. The first command fetches the newest release tag from GitHub.

cd ~/keycloak
KC_VERSION=$(curl -s https://api.github.com/repos/keycloak/keycloak/releases/latest | jq -r .tag_name)
echo "$KC_VERSION"
docker compose exec -T postgres pg_dump -U keycloak -Fc keycloak > ~/keycloak-backup-$(date +%F).dump
sed -i "s/^KC_TAG=.*/KC_TAG=${KC_VERSION}/" .env
docker compose pull -q keycloak
docker compose up -d keycloak

Then wait on the readiness endpoint on the management port, 9000, before you trust the new container. The first start after an upgrade takes longer than usual because the schema migration runs before the server reports ready. Without health endpoints enabled the loop never ends, so press Ctrl+C and check docker compose logs keycloak instead.

until curl -sf http://localhost:9000/health/ready >/dev/null; do sleep 3; done; curl -s http://localhost:9000/health/ready | jq -c
docker compose exec keycloak /opt/keycloak/bin/kc.sh --version

Our run went from 26.6.4 to 26.8.2 in under a minute. The dump was 243 KB for a lab database, and the log showed “Updating database” as the schema migrated.

Docker Compose upgrade of Keycloak from 26.6.4 to 26.8.2 with a pg_dump backup, health check and kc.sh version

Recreating the container drops the kcadm session we kept in /tmp, so log in again with the same config credentials command before checking the data. Our user alice came through intact.

docker compose exec keycloak /opt/keycloak/bin/kcadm.sh get users -r acme --config /tmp/kcadm.config -q username=alice --fields username,email,emailVerified --format csv --noquotes

Username, email and verification state were unchanged, which is the quick sign that the migration kept user data.

alice,[email protected],true

In the console, the Server info tab now reads 26.8.2, which is the screen to show an auditor.

Keycloak admin console Server info tab showing version 26.8.2 after the upgrade

Once the version reads 26.8.2 you can turn Forgot password back on with -s resetPasswordAllowed=true for the realms that need it, which we did for acme. A production install built on an optimized image, as in our Keycloak production setup in Docker or Podman, needs one extra step: change the FROM tag in the Containerfile and rebuild, since the running tag is your own image.

Upgrading a zip install with kc.sh

No package manager stands behind the zip distribution, so an upgrade means unpacking the new release beside the old one and carrying your configuration across. The archive ships no JVM, and our VM used the OpenJDK 21 package from Ubuntu. The schema migration is one-way here too, so dump the database before the new tree starts (the same pg_dump -Fc as the compose step, run against your database host). Download the latest release and its checksum, then verify the archive.

KC_VERSION=$(curl -s https://api.github.com/repos/keycloak/keycloak/releases/latest | jq -r .tag_name)
curl -sLO https://github.com/keycloak/keycloak/releases/download/${KC_VERSION}/keycloak-${KC_VERSION}.zip
curl -sLO https://github.com/keycloak/keycloak/releases/download/${KC_VERSION}/keycloak-${KC_VERSION}.zip.sha1

The .sha1 file holds only the hash, so build the line sha1sum -c expects from it.

echo "$(cat keycloak-${KC_VERSION}.zip.sha1)  keycloak-${KC_VERSION}.zip" | sha1sum -c

Go no further unless the check prints OK. A truncated download fails here rather than halfway through the build.

keycloak-26.8.2.zip: OK

Stop the old server, unpack the new one, then copy providers/, themes/ and everything in conf/ except cache-ispn.xml from the old tree. The Keycloak upgrading guide excludes that file so an old copy cannot downgrade the new defaults, and 26.4 also moved the default caches out of it. If you customised it, re-apply your changes to the new file. Our old tree was 26.4.7 in ~/zip; adjust the directory names to yours. The kc.sh build step re-applies your build-time options, here the PostgreSQL driver and health endpoints, against the new binaries.

unzip -q keycloak-${KC_VERSION}.zip
find keycloak-26.4.7/conf -mindepth 1 -maxdepth 1 ! -name cache-ispn.xml -exec cp -a {} keycloak-${KC_VERSION}/conf/ \;
cp -a keycloak-26.4.7/providers/. keycloak-${KC_VERSION}/providers/
cp -a keycloak-26.4.7/themes/. keycloak-${KC_VERSION}/themes/
keycloak-${KC_VERSION}/bin/kc.sh build --db=postgres --health-enabled=true
keycloak-${KC_VERSION}/bin/kc.sh --version

Our build ended with “Server configuration updated and persisted”, and the new tree reported its version.

Keycloak 26.8.2
JVM: 21.0.13.1 (Ubuntu OpenJDK 64-Bit Server VM 21.0.13.1+2-1-26.04.1-Ubuntu)
OS: Linux 7.0.0-1017-gcp amd64

Point your systemd unit at the new directory and start it; the schema migrates on first start, as with the container. Confirm the switch took with the same startup log line from earlier, which must now read “Keycloak 26.8.2 on JVM”, or with the Server info tab in the console. A symlink such as /opt/keycloak pointing at the versioned tree makes the next upgrade a one-line change.

Upgrading through the Keycloak Operator

With the Operator, the Keycloak image comes from the Operator release unless your Keycloak resource sets spec.image. Upgrading the Operator therefore upgrades Keycloak. Our test cluster was kind with Operator 26.6.4 managing a one-pod sso instance, the same layout as our Keycloak Operator deployment with CloudNativePG at a smaller scale. Take a database backup first, as with the other paths, because the Operator migrates the schema on the first new pod. Then apply all four CRDs from the new release, because 26.7 added the OIDC and SAML client CRDs that a 26.6 cluster lacks and the new Operator expects them.

KC_VERSION=$(curl -s https://api.github.com/repos/keycloak/keycloak/releases/latest | jq -r .tag_name)
for f in keycloaks keycloakrealmimports keycloakoidcclients keycloaksamlclients; do kubectl apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/${KC_VERSION}/kubernetes/$f.k8s.keycloak.org-v1.yml; done
kubectl -n keycloak apply -f https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/${KC_VERSION}/kubernetes/kubernetes.yml
kubectl -n keycloak rollout status deploy/keycloak-operator --timeout=300s

Next, the new Operator rolls the Keycloak StatefulSet to its own image. Wait for the pod to carry the new tag and the resource to report Ready, then confirm from inside the pod.

until kubectl -n keycloak get pod sso-0 -o jsonpath='{.spec.containers[0].image}' 2>/dev/null | grep -q ${KC_VERSION}; do sleep 5; done; kubectl -n keycloak wait keycloak/sso --for=condition=Ready --timeout=600s
kubectl -n keycloak get pods -o custom-columns=NAME:.metadata.name,IMAGE:.spec.containers[0].image,STATUS:.status.phase
kubectl -n keycloak exec sso-0 -- /opt/keycloak/bin/kc.sh --version

Both the Operator and the sso-0 pod moved to 26.8.2, and the instance kept its PostgreSQL data through the roll.

Keycloak Operator upgrade on Kubernetes: operator and sso-0 pod running 26.8.2 images, kc.sh version 26.8.2

Two cases need more than this. If your resource pins spec.image, the Operator upgrade will not touch Keycloak, so change that field to the fixed tag as well. If a third-party Helm chart runs your Keycloak instead, patch it with the same image change through the image tag value of the chart. We didn’t test a chart in this lab. On OpenShift with RHBK, update the Operator subscription so it picks up the RHSA-2026:56519 or 56524 bundle.

Production hardening after the patch

Patching closes this flaw, and a few settings decide whether you can answer “were we hit?” next time. We would put these in place before switching password resets back on.

  • User events on every realm: with an expiration that covers your patch window. We used 30 days (eventsExpiration=2592000); every login adds rows, so size it against your login volume, but without stored events the audit above has nothing to read.
  • Event forwarding to your SIEM: successful events only reach the log at DEBUG, so raise them with --spi-events-listener--jboss-logging--success-level=info at start, or ship them through an event listener provider.
  • A permanent admin and MFA: the bootstrap admin is meant to be temporary, and the console warns about it. Realm admins with a second factor survive a password takeover.
  • Advisory feeds for both sources: watch the Keycloak GHSA list and the Red Hat CVE pages, because this fix was public at Red Hat three months before the upstream advisory.

Our JVM write-up from this week still applies once you are on 26.8.2. The Java4Shell patch for Keycloak covers the image rebuild and how to check its bundled OpenJDK. If your realms federate users from a directory, the Keycloak and FreeIPA integration explains which users can even use Keycloak’s reset flow, since LDAP-backed passwords may be read-only. And if this incident has you weighing the alternatives, our Keycloak, authentik, Zitadel and Authelia comparison measured all four on the same VM.

Keep reading

Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs Security Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Security UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 nginx HTTP/2 RCE CVE-2026-123007: Check, Disable HTTP/2, Patch Security nginx HTTP/2 RCE CVE-2026-123007: Check, Disable HTTP/2, Patch WP Rocket CVE-2026-125812: Check, Patch and Hunt Planted Files Security WP Rocket CVE-2026-125812: Check, Patch and Hunt Planted Files Enable Post-Quantum TLS in Nginx, Apache, HAProxy and OpenSSH Security Enable Post-Quantum TLS in Nginx, Apache, HAProxy and OpenSSH What is WPA2 Encryption and How to Implement It on a Linux Machine Security What is WPA2 Encryption and How to Implement It on a Linux Machine

Leave a Comment

Press ESC to close