CVE-2026-114938 (Java4Shell) — Impact on Red Hat Single Sign-On 7.6 and Red Hat build of Keycloak

Solution verified - Updated on

Request a new translation or translation update

A translation for your language preference does not exist. Click below to request a translation for your selected language.

Submit request

Environment

  • Red Hat Single Sign-On 7.6 running on OpenJDK 17 (17.0.6 or later)
  • Red Hat build of Keycloak 26.4
  • Red Hat build of Keycloak 26.6+
  • x86-64 hosts or virtual machines exposing the avx512vbmi CPU feature to Java
  • JVM with Base64 intrinsics enabled (default) and not limited to AVX2 with -XX:UseAVX=2

Issue

A critical vulnerability (CVE-2026-114938), known as Java4Shell, has been identified in OpenJDK's accelerated Base64 decoder. The flaw affects x86-64 systems where the CPU exposes the AVX-512 VBMI feature and the JVM runs an unpatched OpenJDK build from 17.0.6 onward (including OpenJDK 21 and 25 builds).

Keycloak accepts Base64-encoded values on several URL paths that do not require the caller to be authenticated. On systems with the vulnerable JDK and an AVX-512 VBMI-capable CPU, an unauthenticated attacker can send a specially crafted Base64 value that triggers a memory corruption in the JVM's accelerated Base64 decoder. Researchers have demonstrated that this leads to pre-authentication remote code execution.

Before applying any mitigation, check whether your deployment is affected. Not all systems are vulnerable — only x86-64 hosts whose CPU exposes the avx512vbmi feature and that run an unpatched OpenJDK build (17.0.6+, 21, or 25) are at risk. See the Diagnostic Steps section below to determine whether your systems are affected.

The following Red Hat products are affected when running on vulnerable hardware and JDK combinations:

  • Red Hat Single Sign-On 7.6 — when running on the supported configuration with OpenJDK 17
  • Red Hat build of Keycloak 26.4
  • Red Hat build of Keycloak 26.6
  • Red Hat build of Keycloak 26.8

Customers running on affected systems must apply the mitigation or upgrade on every instance, including failover nodes and nodes used during rolling updates.

Resolution

There are two ways to address this vulnerability:

  1. Upgrade the JDK or RHBK container image (permanent fix) — Install a JDK build or RHBK container image whose vendor confirms it fixes CVE-2026-114938. Updated RHBK container images and JDK builds may be available before all customers read this advisory. Check RHSB-2026-018 for the latest patched versions.

  2. Apply the JVM mitigation flag — Add -XX:-UseBASE64Intrinsics to the JVM startup flags and restart every instance. This disables the vulnerable accelerated Base64 path while retaining other AVX-512 optimizations. This is Red Hat's preferred interim mitigation when an upgraded JDK or container image is not yet available.

For RH-SSO 7.6 (ZIP/TAR.GZ installation):

Set JAVA_OPTS_APPEND before starting the server:

export JAVA_OPTS_APPEND="${JAVA_OPTS_APPEND:+$JAVA_OPTS_APPEND }-XX:-UseBASE64Intrinsics"
./bin/standalone.sh

If a service manager such as systemd starts RH-SSO, set JAVA_OPTS_APPEND in that service's environment and restart the service.

For RHBK 26.4, 26.6, and 26.8 (ZIP/TAR.GZ installation):

export JAVA_OPTS_APPEND="${JAVA_OPTS_APPEND:+$JAVA_OPTS_APPEND }-XX:-UseBASE64Intrinsics"
./bin/kc.sh start

For RHBK container deployments (Docker/Podman):

Add the environment variable to the existing run command:

-e JAVA_OPTS_APPEND=-XX:-UseBASE64Intrinsics

For Docker Compose, add to the Keycloak service:

environment:
  JAVA_OPTS_APPEND: "-XX:-UseBASE64Intrinsics"

For RHBK Operator deployments:

Add the variable to the keycloak container in the Keycloak custom resource:

apiVersion: k8s.keycloak.org/v2beta1
kind: Keycloak
metadata:
  name: example-kc
spec:
  unsupported:
    podTemplate:
      spec:
        spec:
          containers:
            - name: keycloak
              env:
                - name: JAVA_OPTS_APPEND
                  value: "-XX:-UseBASE64Intrinsics"

Merge this into your existing resource, preserving database, TLS, and other settings. Make sure the Operator replaces or restarts every Keycloak pod.

Note: For RHBK 26.4, use apiVersion: k8s.keycloak.org/v2alpha1 instead of v2beta1.

For the Keycloak Operator:

The Keycloak Operator runs in a separate Java process and can also have the vulnerable Base64 decoder. However, the Operator does not expose any public API — exploiting it would typically require modifying Base64-encoded Kubernetes secrets, which implies namespace admin permissions. The risk of exploitation is therefore low.

To mitigate the Operator JVM in OLM-managed deployments, add the environment variable to the Subscription resource:

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: rhbk-operator
spec:
  config:
    env:
      - name: JDK_JAVA_OPTIONS
        value: "-XX:-UseBASE64Intrinsics"

Merge this into your existing Subscription, then verify that OLM propagates the variable to the Operator pod.

See the upstream guidance at https://www.keycloak.org/2026/11/java4shell-vulnerability-cve-2026-114938#_what_about_the_keycloak_operator_itself for details.

Permanent fix:

Install a patched JDK build or an updated RHBK container image that fixes CVE-2026-114938, then redeploy and verify every instance. Updated RHBK container images and JDK builds may become available on a rolling basis — check RHSB-2026-018 for the latest patched versions. Once you have upgraded, you can remove the -XX:-UseBASE64Intrinsics flag.

Root Cause

CVE-2026-114938 is a flaw in OpenJDK's accelerated Base64 decoder. When the JVM uses AVX-512 VBMI instructions for Base64 decoding (enabled by default on CPUs that expose the avx512vbmi feature), a specially crafted malformed Base64 value can corrupt the Java process's memory. This affects unpatched OpenJDK builds from 17.0.6 onward, including OpenJDK 21 and 25.

Keycloak processes Base64-encoded data on unauthenticated request paths, making it reachable by an attacker without prior authentication.

Diagnostic Steps

  1. Check the CPU feature on the Keycloak host or virtual machine:

    grep -m1 '^flags' /proc/cpuinfo | grep -qw avx512vbmi && echo 'AVX-512 VBMI available'
    

    If this prints nothing, the CPU does not expose AVX-512 VBMI and is not known to be affected. On a container platform, run the check on the node that executes the Keycloak container.

  2. Check the Java version the deployment uses:

    For a ZIP/TAR.GZ installation, run java -version with the Java executable used to start Keycloak or RH-SSO:

    java -version
    

    For a container image:

    docker exec <keycloak-container> java -version
    # Or on Kubernetes:
    kubectl exec <keycloak-pod> -c keycloak -- java -version
    

    The instance is at risk if all of the following apply:

    • It runs an unpatched OpenJDK build from 17.0.6 onward (including unpatched OpenJDK 21 and 25 builds)
    • Its x86-64 host or virtual machine exposes the avx512vbmi CPU feature to Java
    • The running JVM has Base64 intrinsics enabled and has not been limited to AVX2 with -XX:UseAVX=2
  3. Verify the mitigation on the running JVM:

    After applying the mitigation and restarting, verify the flag is active on the running JVM:

    jcmd <keycloak-pid> VM.flags -all | grep -F UseBASE64Intrinsics
    

    For Kubernetes:

    kubectl exec <keycloak-pod> -c keycloak -- jcmd io.quarkus.bootstrap.runner.QuarkusEntryPoint VM.flags -all | grep -F UseBASE64Intrinsics
    

    Expected output:

    bool UseBASE64Intrinsics = false {product} {command line}
    

    Repeat the check for every Keycloak/RH-SSO process after restart or rollout, including every pod or container. Seeing the variable in a service or container's environment is not sufficient; the live JVM must report UseBASE64Intrinsics = false.

This solution is part of Red Hat's fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.