Contents
CVE-2026-114938, which its finders named Java4Shell, is an out-of-bounds write in HotSpot’s x86-64 Base64 decode intrinsic. Oracle and the OpenJDK updates project shipped fixed builds on November 17 (17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1). Not every vendor has caught up. Red Hat’s bulletin, last updated November 20, still lists no fixed packages and says only that it is “expediting the release of fixes.” If you run RHEL or UBI-based Java images, or a product that bundles its own JRE, the thing standing between you and the bug this week is a JVM flag.
That flag is where the operational risk sits. Three candidates are circulating in advisories, chat threads and copied runbooks. Pushed fleet-wide through a shared environment variable, one of them takes every JVM down at startup, one takes down only your ARM nodes, and the correct one can be delivered in a way that silently skips some processes.
What the bug needs
The details from Calif’s write-up decide where any of this matters. The intrinsic computes a store mask for the padded tail of the input. When the tail is padding (=, ==, X= and so on), the output length underflows to -1 or -2, bzhiq produces an all-ones mask, and a masked evmovdqub writes a full 64 bytes. For 64 A characters followed by =, the output buffer is 50 bytes, the store starts at offset 48, and offsets 50 through 111 are written out of bounds. On JDK 17 the trigger needs 128 characters before the =. Java then rejects the input, but only after the write.
Two preconditions narrow exposure:
- The CPU must expose AVX-512 VBMI (Ice Lake and newer Xeons, Zen 4 and newer). ARM64 never runs this code. On Linux, all four of
avx512f,avx512bw,avx512vbmiandbmi2must appear in/proc/cpuinfo. - C2 must have compiled the decoder with the intrinsic. Calif’s proof of concept warms it with 200,000 valid decodes first. A server that decodes Authorization headers, SAML artifacts or session tokens does that warm-up for the attacker.
The first precondition means exposure is a property of the node, not the image. The same container can be exploitable on an Ice Lake instance and inert on a Skylake or Graviton one in the same autoscaling group. Your scanner will flag the image either way, which is correct, but it also means “we reproduced nothing in staging” proves little if staging runs on different hardware.
The three flags, tested
These results come from OpenJDK 21.0.13.0.3, the current Ubuntu 24.04 package and one of the affected builds, on a Xeon that reports all four required CPU flags.
-XX:DisableIntrinsic=_base64_decodeBlock
This is a diagnostic option. On its own, the JVM exits with status 1 before running anything:
Error: VM option 'DisableIntrinsic' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions.
Error: The unlock option must precede 'DisableIntrinsic'.
Error: Could not create the Java Virtual Machine.
Set through JAVA_TOOL_OPTIONS, the result is the same for every JVM that reads that variable. Upwind calls this advice “wrong as written” and describes it, accurately, as a fleet-wide outage. It works with -XX:+UnlockDiagnosticVMOptions placed before it, but there is no reason to choose it over the product flag below.
-XX:UseAVX=2
This works on x86-64. With it set, the JVM’s CPU feature line (-Xlog:os+cpu=info) drops every avx512 feature, avx512_vbmi included, so the vulnerable stub can’t be selected. UseAVX is an architecture-specific flag (-XX:+PrintFlagsFinal labels it {ARCH product}), and Calif, Upwind and Red Hat all say an ARM64 JVM does not recognize it and refuses to start. That path wasn’t tested here, since no ARM host was available, so that claim rests on those three sources. If one Helm values file or ConfigMap feeds both an amd64 and an arm64 node pool, this flag fixes one pool and puts the other into a crash loop. It also turns off every other AVX-512 optimization, which you pay for in throughput.
There is a second trap here. With UseAVX=2, UseBASE64Intrinsics still reports true. Red Hat’s verification step is jcmd <pid> VM.flags -all | grep -F UseBASE64Intrinsics, expecting false. A host mitigated with UseAVX=2 fails that check even though it is protected. If you mix the two flags, your verification has to accept either.
-XX:-UseBASE64Intrinsics
This is the one to use. It is a shared product flag ({product}, not {ARCH product}), so it is accepted on every architecture. It turns off only the Base64 intrinsics, and Upwind reports it stopped the overflow on every affected version in its lab. Spell it exactly. -XX:-UseBase64Intrinsics with a lowercase “ase” is an unrecognized option and also stops the JVM from starting, though at least the error suggests the right spelling.
The environment variable decides which JVMs get it
Red Hat’s Keycloak guidance says to set the flag through JDK_JAVA_OPTIONS. That is fine for Keycloak, but it is not a general recipe. The java man page describes JDK_JAVA_OPTIONS as content prepended to the command line of the java launcher. The JVM itself does not read it. JAVA_TOOL_OPTIONS is read by the JVM when it is created, whatever started it.
The difference is easy to see with a JDK tool that has its own launcher:
$ JDK_JAVA_OPTIONS=-XX:-UseBASE64Intrinsics java -XX:+PrintFlagsFinal -version | grep UseBASE64
bool UseBASE64Intrinsics = false {product} {command line}
$ JDK_JAVA_OPTIONS=-XX:-UseBASE64Intrinsics javac -J-XX:+PrintFlagsFinal -version | grep UseBASE64
bool UseBASE64Intrinsics = true {product} {default}
$ JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics javac -J-XX:+PrintFlagsFinal -version | grep UseBASE64
bool UseBASE64Intrinsics = false {product} {environment}
The same gap applies to anything that creates a JVM through JNI instead of exec’ing java: Windows service wrappers such as procrun in JVM mode, jsvc, and vendor appliances with their own startup binary. Those are often the products that bundle their own JRE, which are also the ones you can’t patch yourself. For them, use JAVA_TOOL_OPTIONS or the product’s own JVM options file.
JAVA_TOOL_OPTIONS has a cost too. Both variables cause the JVM to print a “Picked up …” line to stderr, and anything that parses stderr from a Java subprocess will see it. That’s usually harmless, but it is worth knowing before you set it globally on CI runners.
Verify the process, not the config
A flag in a manifest doesn’t protect a JVM that started before the manifest changed. Every process needs a restart, and in Kubernetes that means a rollout, not a ConfigMap edit. Then check what is actually running:
jcmd <pid> VM.flags -all | grep -F UseBASE64Intrinsics
false means the intrinsic is off. The origin column tells you how the flag got there ({command line} or {environment}), which is useful when you are tracing why one deployment picked it up and another didn’t. For hosts mitigated with UseAVX=2, check jcmd <pid> VM.command_line for the flag instead.
When the patched JDK arrives, the version check has its own catch. The fix sits in the fourth version element. Runtime.version().update() returns 13 for both the vulnerable 21.0.13.0.3 and the fixed 21.0.13.1, and 21 for both Corretto 17.0.21.0.11 and 17.0.21.1.2. Runtime.Version.compareTo orders them correctly. A compliance gate that compares only feature, interim and update, or a regex that captures three numbers, will pass the vulnerable build. Then remove the flag, because it disables a fast path you want back.
Rollout order
Patch where a fixed build exists. Where it doesn’t, push -XX:-UseBASE64Intrinsics through JAVA_TOOL_OPTIONS, not JDK_JAVA_OPTIONS, roll every pod, and confirm with jcmd on a sample from each node pool and each launcher type. Don’t use DisableIntrinsic. Use UseAVX=2 only on hosts you know are x86-64, and only if you’ve adjusted your verification to match.
Sources
- Calif: Java4Shell (CVE-2026-114938) technical write-up and timeline
- Red Hat Security Bulletin RHSB-2026-018
- Upwind: Java4Shell, what we know now and what comes next
- Amazon Corretto 17 changelog (17.0.21.1.2)
- Oracle: the
javacommand,JDK_JAVA_OPTIONS - Qualys: How to find, mitigate and patch Java4Shell
- The Hacker News: Java4Shell vendor fix table