Skip to content

[CVE-2026-114938] Mitigate OpenJDK Base64 intrinsic vulnerability (CVE-2026-114938 / Java4Shell) #55293

Closed

Description

@Diogo-Rego

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

dist/quarkus

Bug Description

A critical vulnerability (CVE-2026-114938, also known as "Java4Shell") was recently disclosed affecting OpenJDK's hardware-accelerated Base64 decoder intrinsic (java.util.Base64.Decoder) on x86-64 processors supporting AVX-512 VBMI instructions.

Security research by Calif demonstrated that in default configurations, Keycloak endpoints processing Base64 data prior to authentication (e.g. Basic auth headers, SAML assertions, and JWTs) can trigger memory corruption / heap overflow in vulnerable JVM builds.

Proposed Solution

Until upstream vendor patches are widely distributed across all base container images and environments, disable the vulnerable Base64 intrinsics by default in Keycloak startup scripts:

  • Add -XX:-UseBASE64Intrinsics to default JAVA_OPTS in kc.sh and kc.bat.
  • Include -XX:-UseBASE64Intrinsics in the Keycloak Operator Dockerfile entrypoint.

Version

nightly / latest

Regression

  • The issue is a regression

Expected behavior

Keycloak startup scripts (kc.sh, kc.bat) and container images should include the JVM flag -XX:-UseBASE64Intrinsics by default to prevent exploitation of the OpenJDK hardware-accelerated Base64 decoder flaw (CVE-2026-114938) until vendor-patched OpenJDK packages are broadly distributed in base images.

Actual behavior

By default, Keycloak runs with OpenJDK hardware-accelerated Base64 intrinsics enabled. On x86-64 hosts equipped with AVX-512 VBMI instructions (e.g. Intel Ice Lake, AMD Zen 4), malformed Base64 payloads decoded prior to authentication can cause heap out-of-bounds write / memory corruption (CVE-2026-114938), potentially exposing Keycloak to remote code execution or denial of service before vendor JDK packages are patched.

How to Reproduce?

  1. Run Keycloak using OpenJDK 17 or 21 on an x86-64 host with AVX-512 VBMI instructions (e.g., Intel Ice Lake or AMD Zen 4).
  2. Send malformed Base64-encoded payloads in pre-authentication headers (such as HTTP Basic authorization, JWT tokens, or SAML assertions).
  3. The OpenJDK HotSpot C2 Base64 intrinsic calculates an incorrect negative output length and triggers a heap out-of-bounds write / memory corruption.

Anything else?

References:

Pinned by stianst

Activity

  1. added
    kind/bug
    on Nov 17, 2026
  2. added theissue type on Nov 17, 2026
  3. added
    area/dist/quarkus
    on Nov 17, 2026
  4. added a commit that references this issue on Nov 17, 2026
    783a39a
  5. changed the issue type fromtoon Nov 18, 2026
  6. added
    kind/cve
    and removed
    kind/bug
    on Nov 18, 2026
  7. changed the title [-]Mitigate OpenJDK Base64 intrinsic vulnerability (CVE-2026-114938 / Java4Shell)[/-] [+][CVE-2026-114938] Mitigate OpenJDK Base64 intrinsic vulnerability (CVE-2026-114938 / Java4Shell)[/+] on Nov 18, 2026
  8. gillg commented on Nov 18, 2026

    @gillg

    Thanks for the mitigation !

    Can we hope having a fresh docker image, with the JVM patched for the versions 26.x by today ?
    The mitigation is fine but the patch is still safer.
    Also, for long term, the mitigation may have negative impacts on perfs on Keycloak with a lot of users and tokens operations.

  9. ptman commented on Nov 18, 2026

    @ptman

    For current mitigation, pass JAVA_OPTS_APPEND="-XX:-UseBASE64Intrinsics" to the container startup (kc.sh should pick that up https://github.com/keycloak/keycloak/blob/main/quarkus/dist/src/main/content/bin/kc.sh#L132 )

  10. 10 remaining items

  11. AriefLuthfi79 commented on Nov 19, 2026

    @AriefLuthfi79

    Any update?

  12. KarthickeyanSekar commented on Nov 19, 2026

    @KarthickeyanSekar

    Any update on the patch release?

  13. ptman commented on Nov 19, 2026

    @ptman
  14. batorse commented on Nov 19, 2026

    @batorse

    For those eager to patch, the 26.8.2-3 image was build 20 minutes ago. I assume it is patched, but for a definitive answer you will have to wait till an announcement.

    In general if an open source project has an issue you are interested in, please react to via emoji to register your interest, work on a patch or contact the representative of your paid support contract. There is limited value in commenting every few hours, the maintainers might as well be asleep.

  15. stianst commented on Nov 19, 2026

    @stianst
    Contributor

    Keycloak container images for 26.8 have been updated to Red Hat OpenJDK 21.0.13.1, which includes fixes for CVE-2026-114938.

    The updated tags include latest, 26.8, 26.8.2, and 26.8.2-3.

    If you are not using the container images or building your own check if your OpenJDK vendor has released updates. Fixed
    versions include 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Older releases of OpenJDK 17, 21, and 25 are affected.

    As of publishing Oracle and Red Hat have released updates. Eclipse Temurin
    for Linux have been released, while other platforms are in-progress
    .

  16. pinned a comment and unpinned a comment on Nov 19, 2026
  17. tilalx commented on Nov 19, 2026

    @tilalx

    quay.io/keycloak/keycloak:26.8.2-3 ships java-21-openjdk-headless-21.0.13.1.2-1.2.el9. That's the exact RHEL 9 package from RHSA-2026:100567 (https://access.redhat.com/errata/RHSA-2026:100567), which fixes CVE-2026-114938.

  18. chusiang commented on Nov 20, 2026

    @chusiang

    It works after recreating the Docker container via docker-compose, rather than just restarting it.

    Until an image with a fixed JDK is available, set JAVA_OPTS_APPEND=-XX:-UseBASE64Intrinsics on every Keycloak container and restart it. The 26.8.2 kc.sh already appends JAVA_OPTS_APPEND to the JVM options, so no image rebuild is needed. If the variable is already set, append the flag to its existing value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dist/quarkuskind/cveseverity/criticalteam/cloud-native

    Type

    Fields

    No fields configured for cve.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions