DEV Community

Cover image for Java4Shell: What OpenJDK Teams Need to Know About CVE-2026-114938
jamilxt
jamilxt

Posted on Edited on Originally published at jamilxt.com

Java4Shell: What OpenJDK Teams Need to Know About CVE-2026-114938

A malformed Base64 value can do more than make a Java decoder reject input. On some x86-64 systems, it can trigger a memory write beyond the intended array. That is the core of CVE-2026-114938, the OpenJDK flaw being called Java4Shell.

Red Hat reports pre-authentication RCE demonstrations against some widely deployed applications, while Calif.io explains that reliable exploitation depends on an application-specific chain. This is serious, but not one exploit that works against every Java service.

What is vulnerable?

The flaw sits in an optimized Base64 decoding path in HotSpot, OpenJDK's virtual machine. Base64 turns binary data into text and is often used to carry credentials and certificate data through text-based systems.

In certain supported configurations, HotSpot replaces part of the Java decoder with a faster native routine. This routine can use AVX-512 VBMI instructions available on some x86-64 processors. Calif.io's technical analysis describes a length calculation error when the decoder handles a short final input fragment with invalid padding. The calculated output size can become negative. The native routine then builds a write mask from that value without checking that it is valid, allowing the write to pass the end of the destination array.

That is a memory-safety bug inside the runtime, not simply a bad input-validation rule in one application. An application may catch the decoder's exception and still have memory corrupted before the exception is raised.

The exposure is conditional

A vulnerable Java version alone does not tell you whether a specific service can trigger the flaw. Calif.io's analysis identifies several conditions that matter:

  • The service uses an affected Java runtime.
  • It runs on x86-64 hardware with AVX-512 VBMI support and enters the vulnerable decoder path.
  • Attacker-controlled data reaches the relevant Base64 decoder without being rejected or transformed first.

Review endpoints that pass untrusted data to java.util.Base64.Decoder; confirm the exact runtime build and CPU support.

Affected-version lists differ because notices cover different vendors. OpenJDK names the 17/21 and 25/27 lines; Red Hat says its OpenJDK 8/11 lines lack the path, while Oracle's CVE-specific entry has separate scope. Check the exact vendor advisory for your runtime.

Why the severity numbers differ

The CVE record lists 8.1 under CVSS 3.1. Calif.io reports 9.2 under CVSS 4.0. These scores use different scoring systems and are not directly comparable. Neither score replaces checking the JDK and CPU capabilities, then confirming whether attacker-controlled input reaches the decoder.

Oracle's quarterly patch covers many products; a version appearing in that broad list does not mean every CVE affects it. Check the vendor's exact CVE entry.

What Java teams should do

First, find the runtime each production process actually uses. Check application containers, vendor appliances, build agents, application servers, and Java runtimes bundled with products. The java command on an administrator's shell may not be the runtime used by a running service.

Check the JVM and CPU inside the container

Run these checks inside the same container that runs the Java service. If the image has more than one JDK, use the runtime binary that the service starts.

java -version 2>&1
grep -o avx512vbmi /proc/cpuinfo | head -1
jcmd <PID> VM.flags
Enter fullscreen mode Exit fullscreen mode

The first command prints the runtime vendor and full build. The second scans the CPU flags visible to the container for AVX-512 VBMI. If it prints avx512vbmi, the hardware requirement is present. If it prints nothing, no CPU visible to the container reports that feature and the hardware prerequisite is absent. Seeing avx512f, avx512bw, or bmi2 without avx512vbmi does not meet the stated VBMI condition.

If jcmd is available in the image and can attach to the process, substitute the Java process ID for <PID>; this reports flags for the running JVM. Otherwise, inspect that process's startup arguments. A separate java -XX:+PrintFlagsFinal -version invocation reports flags for a new JVM, not necessarily the service process. UseAVX=3 and UseBASE64Intrinsics=true do not prove that the CPU exposes AVX-512 VBMI.

Treat the runtime as potentially exposed only when all four conditions hold: the exact vendor build is affected and unpatched; the JVM runs on x86-64 and avx512vbmi is visible; its active UseAVX setting is not 2 or lower; and attacker-controlled Base64 reaches java.util.Base64.Decoder. Red Hat documents these conditions and the CPU check in its CVE-2026-114938 bulletin.

For Kubernetes, check each Java container and every node pool where its pod may be scheduled. A pod can move to a node with a different CPU feature set. This is a Java runtime vulnerability, not a Kubernetes control-plane flaw.

Apply the fix

Use the full runtime version and vendor to choose the fix. Amazon's Corretto 21 changelog lists version 21.0.13.1.2, released November 17, 2026, as addressing CVE-2026-114938. Corretto 21.0.13.0.11 predates that release. For Amazon Linux 2023, AWS lists package build 21.0.13.1.2 in advisory ALAS2023-2026-3479 and gives this update command:

dnf update java-21-amazon-corretto --releasever 2023.12.20261117
Enter fullscreen mode Exit fullscreen mode

For a container, apply the package update in the image build. Other base images and JDK vendors may use different package versions, so verify the exact CVE advisory before changing the image.

Rebuild the image and roll out new pods. Restarting a process does not replace an old runtime inside an unchanged image. After deployment, run the same checks again and confirm the new build is active in every replica.

If a fixed build is not yet available, Red Hat recommends the temporary JVM option -XX:-UseBASE64Intrinsics. It disables the affected accelerated Base64 path. On x86-64 only, -XX:UseAVX=2 is another option, but it also disables AVX-512 for other JVM work and can reduce performance. Do not use UseAVX=2 on ARM64. Apply a workaround at JVM startup, restart the process, and remove it after installing a fixed runtime.

The useful lesson in Java4Shell

Inventory the runtime build, CPU features, and untrusted Base64 paths. Patch and verify every deployed replica, but do not assume all Java services are equally exposed.

Sources

Top comments (0)