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:

  • CVE-2026-114938 (Java4Shell)
  • Technical analysis: https://securityonline.info/java4shell-cve-2026-114938/
  • Calif Advisory: Pre-auth RCE vulnerability in OpenJDK Base64 decoding on AVX-512 VBMI CPUs.
  • Recommended mitigation: pass -XX:-UseBASE64Intrinsics or -XX:DisableIntrinsic=_base64_decodeBlock to the JVM.
Pinned by stianst

Activity

  1. added theissue type on Nov 17, 2026
  2. added a commit that references this issue on Nov 17, 2026
    783a39a
  3. changed the issue type fromtoon Nov 18, 2026
  4. added
    kind/cveIssues identified as CVEs on third-party dependencies, or issues which Keycloak is not affected
    and removed
    kind/bugCategorizes a PR related to a bug
    on Nov 18, 2026
  5. 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
  6. 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.

  7. 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 )

  8. 6 remaining items

  9. stianst commented on Nov 18, 2026

    @stianst
    Contributor

    ins't it fixed already? https://openjdk.org/groups/vulnerability/advisories/2026-11-17

    Fixes are in, but release are not out

  10. shanytc commented on Nov 18, 2026

    @shanytc

    ins't it fixed already? https://openjdk.org/groups/vulnerability/advisories/2026-11-17

    Fixes are in, but release are not out

    They are too slow ugh...

  11. dnatic09 commented on Nov 18, 2026

    @dnatic09

    RedHat is going to need to release a new hardened Docker image too.

  12. FacuLbsz commented on Nov 18, 2026

    @FacuLbsz

    No patch before gta 6 🙁

  13. AriefLuthfi79 commented on Nov 19, 2026

    @AriefLuthfi79

    Any update?

  14. KarthickeyanSekar commented on Nov 19, 2026

    @KarthickeyanSekar

    Any update on the patch release?

  15. ptman commented on Nov 19, 2026

    @ptman
  16. 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.

  17. 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
    .

  18. pinned a comment and unpinned a comment on Nov 19, 2026
  19. 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.

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/quarkusQuarkus distribution — packaging, container images, server config (kc.sh)kind/cveIssues identified as CVEs on third-party dependencies, or issues which Keycloak is not affectedseverity/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