• security
  • Java
  • OpenJDK
  • patching

Check the Java runtime behind every service for Java4Shell

A beginner-friendly, step-by-step guide to CVE-2026-114938: which OpenJDK builds and CPUs are affected, how to find the Java runtime a running service really uses, and how to patch, mitigate and verify.

Imagine your team runs a login service written in Java. Last week you updated every library in its build file, so the dependency scanner is green. Then a security bulletin says the problem is not in any library you control. It is inside Java itself, in the program that actually runs your code. The scanner never looked there.

That is the situation with CVE-2026-114938, nicknamed “Java4Shell”. Red Hat’s bulletin, updated November 23, 2026, describes a memory-corruption flaw in OpenJDK’s Base64 decoder. Malformed input can corrupt memory when a particular hardware-accelerated code path is used. Red Hat security bulletin RHSB-2026-018

The central idea of this article: the thing you must inventory is the Java runtime each running service starts, not the application’s dependency list. The steps below show how to find it, decide whether it is affected, and fix it.

A few terms first

  • CVE: a public ID for one vulnerability, such as CVE-2026-114938. It lets vendors and readers talk about the same bug.
  • JVM (Java Virtual Machine): the program that runs Java bytecode. When you type java -jar app.jar, a JVM process starts.
  • JDK / runtime: the JDK (Java Development Kit) is the package that contains the JVM, the standard library and tools like jcmd. In this article, “runtime” means the specific Java installation a service runs on.
  • OpenJDK: the open-source Java implementation. Oracle, Red Hat, Eclipse Temurin, Amazon Corretto, Homebrew and others build and ship their own packages from it, each with its own version numbers.
  • Base64: a way to write binary data as text. Web tokens, credentials in HTTP headers and many APIs use it, so a server often decodes Base64 that came from a stranger.
  • Intrinsic: a hand-optimized machine-code version of a Java method that the JVM uses instead of the normal Java code, to run faster. The vulnerable path is the Base64 intrinsic.
  • AVX-512 VBMI: a set of x86-64 CPU instructions. The vulnerable intrinsic is only used when the CPU supports them.
  • Pre-authentication remote code execution (pre-auth RCE): an attacker runs their own code on your server over the network, before logging in.

Why it matters

Red Hat states that pre-authentication remote code execution “has been demonstrated” against widely deployed Java applications in default configurations. That means researchers have shown it can be done. It is a different statement from “attackers are using it in the wild”. The bulletin makes no claim about in-the-wild exploitation and says the investigation is ongoing. Keep the two apart in incident notes: a demonstrated attack justifies fast patching, while a claim that you were attacked needs your own evidence. Red Hat RHSB-2026-018

Who is affected

According to Red Hat, all of these must be true:

  1. Java version: OpenJDK 17.0.6 or later. Red Hat lists its own builds of OpenJDK 17, 21 and 25 as affected. OpenJDK 8 and 11 are not affected.
  2. CPU: x86-64 with AVX-512 VBMI. ARM64 systems and older x86-64 CPUs are not known to be affected.
  3. Input: the application decodes Base64 data that an attacker can influence.

Oracle’s November 2026 Critical Patch Update (Oracle’s quarterly security release) rates the same CVE at CVSS 8.1. CVSS is a 0–10 severity score. Oracle’s table lists these Oracle builds as affected: Java SE 8u511b33-perf, 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3 and 27.0.1.0.3, plus GraalVM for JDK 17.0.21.0.3 and 21.0.13.0.3 and GraalVM Enterprise Edition 21.3.20.0.3. So the Java 27 line comes from Oracle’s list, not Red Hat’s. Oracle’s table lists affected versions; use Oracle’s download pages for the build that fixes them. Oracle Critical Patch Update, November 2026

Each distributor numbers its packages differently. Do not assume an Oracle build number tells you anything about a Temurin, Corretto, Red Hat or Homebrew package. Check the security page of the vendor whose runtime you actually run.

Java also hides inside products. Red Hat lists Red Hat build of Keycloak (26.4, and 26.6 and later) and Red Hat Single Sign-On 7.6 when it runs on OpenJDK 17 as affected, including the JVM inside the Keycloak Operator. Product containers based on RHEL or UBI images are in scope too. If a product bundles its own JVM, patch or mitigate it through that product’s vendor.

Step 1: check the CPU

Run this on each Linux host (or inside a VM, which usually sees the host CPU’s flags). It reads /proc/cpuinfo, the kernel’s list of CPU features. This is a shortened variant of the check in Red Hat’s bulletin:

grep -o -w 'avx512vbmi' /proc/cpuinfo | head -1

If it prints avx512vbmi, the CPU has the feature. If it prints nothing, it does not. Red Hat’s full one-liner checks four flags together (avx512f, avx512bw, avx512vbmi and bmi2) and prints VULNERABLE only when all four are present, so use the bulletin’s version when you need the exact result.

A CPU without the feature still needs patching eventually. The workload might move to newer hardware tomorrow. But it helps you decide what to patch first.

Step 2: find the Java that each service really runs

java -version in your terminal only tells you which Java your shell finds first on its PATH (the list of folders the shell searches for commands). A systemd service, a container or an appliance can start a completely different binary. So start from the running processes.

  1. List Java processes on the host:

    ps -eo pid,user,args | grep '[j]ava'

    The [j] trick stops grep from matching itself. Each line shows a process ID (PID), the user, and the command line.

  2. Resolve the real binary for a PID (Linux only). /proc/<pid>/exe is a link to the program file that process is running:

    readlink /proc/<pid>/exe

    You might see something like /usr/lib/jvm/java-21-openjdk/bin/java or /opt/someproduct/jre/bin/java. Run that exact path with -version to see its vendor and build.

  3. Check how a systemd service starts. systemd is the Linux service manager. This prints the command line it uses:

    systemctl show -p ExecStart <service-name>

    Look for a full path to java or a wrapper script that sets JAVA_HOME.

  4. Check containers. A container brings its own files, including its own Java. Run the check inside it:

    docker exec <container> java -version

    This shows the java on the container’s PATH. If the image’s entry point uses a different path, check that path instead.

  5. Ask the running JVM directly. If the JDK tools are installed, jcmd can talk to a running JVM. Run it as the same user that owns the process:

    jcmd -l
    jcmd <pid> VM.version
    jcmd <pid> VM.system_properties | grep -E '^java\.(home|vendor|runtime\.version)='

    These commands were tested on macOS with Homebrew OpenJDK 21.0.13.0.3 against a test process. VM.version printed OpenJDK 64-Bit Server VM version 21.0.13.0.3, and the properties showed java.vendor=Homebrew and the install path in java.home. That is exactly the vendor, build and location you need for the inventory.

Record one row per service: host, service name, Java path, vendor, full build, CPU flag result, and whether it decodes untrusted Base64 (for example, tokens in login requests).

Step 3: patch through the right vendor

  1. Find your vendor’s fixed package for your Java line and operating system.
  2. If the Java belongs to a product (Keycloak, a build server, an appliance), use that product’s update. Do not copy a new JDK into its install folder by hand.
  3. Restart every JVM so it loads the new runtime: services, containers, standby and failover nodes. A patched package on disk does nothing for a process started yesterday.
  4. Repeat Step 2 on the running processes to confirm they now report the fixed build.

Patch internet-facing services that decode tokens or credentials before login first.

Step 4: temporary mitigation, and how to prove it worked

If you cannot patch today, Red Hat documents two JVM flags:

  • -XX:-UseBASE64Intrinsics turns off only the accelerated Base64 path. Red Hat prefers this option and says it removes the vulnerable code path.
  • -XX:UseAVX=2 turns off all AVX-512 instructions. It can cost performance, and it must only be used on x86-64: an ARM64 JVM will fail to start with it.

Add the flag to the service’s Java options (for example in its systemd unit or container command), then restart. Red Hat warns that setting an environment variable alone is not proof. Check the running process:

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

Expected result with the mitigation: bool UseBASE64Intrinsics = false. This was tested on the same Homebrew OpenJDK 21.0.13.0.3 build: a JVM started with -XX:-UseBASE64Intrinsics showed = false with the source {command line}, and a JVM started without it showed = true with {default}. That machine is Apple Silicon (ARM64), which Red Hat does not list as affected, so this only demonstrates the check, not exposure.

Remove the flag after the fixed build is running.

Common mistakes

  • Trusting java -version in your own shell. It may not be the Java your service uses.
  • Checking the image, not the container. An old container keeps running the old Java until it is recreated.
  • Mapping version numbers across vendors. 21.0.13.0.3 from Oracle and a Red Hat or Temurin package are different products.
  • Forgetting bundled runtimes. Identity servers, CI servers and appliances often ship their own JVM.
  • Using -XX:UseAVX=2 on ARM64. The JVM will not start.
  • Calling “demonstrated” “exploited”. Red Hat says the attack was demonstrated; it does not report in-the-wild attacks.

The same “check what actually runs, then check the vendor’s backport” method applies to other infrastructure. The NGINX TLS early-data article uses it for a web server.

Conclusion

For Java4Shell, inventory the running runtime, not the build file. For each service, find the real Java binary, its vendor and build, the CPU flags and whether it decodes untrusted Base64. Install the vendor’s fixed release and restart every JVM. If you must wait, disable the Base64 intrinsic and prove it with jcmd, then remove the flag once the fix is in place.

Written by Duy Pham Independent developer. I build the apps on this site and write about how they work.

More about me