A memory-corruption bug in OpenJDK’s optimized Base64 decoder, nicknamed “Java4Shell” and tracked as CVE-2026-114938, was patched on 17 November 2026. In the worst case it can lead to remote code execution, but whether you’re actually exposed depends on your Java version, your CPU and how your code decodes Base64.
This guide explains what’s affected, how to check your servers and containers, how to patch, and which temporary JVM flags reduce the risk if you can’t patch yet. Sources: the OpenJDK Vulnerability Advisory for 17 November 2026 and Datadog Security Labs’ technical analysis.
What’s the bug?
CVE-2026-114938 is an out-of-bounds write in HotSpot’s AVX-512 implementation of Base64 decoding. The JIT compiler (C2) can replace Java’s decodeBlock() with a fast native routine (an intrinsic) that uses AVX-512 VBMI instructions.
Datadog’s analysis shows that certain malformed inputs, for example 128 A characters followed by a single =, make the routine’s final-fragment handler compute a negative output length. That negative value then produces a store mask that writes a full 64-byte vector, so the decoder writes past the end of the destination array. In their test, 62 bytes were written beyond a 98-byte array.
Two details make it nasty:
- The decoder still throws
IllegalArgumentExceptionfor the bad input, but by then memory next to the array is already corrupted. Catching the exception doesn’t undo the damage. - Symptoms can appear far from the decoder call, such as a JVM crash during garbage collection.
Datadog stresses that denial of service is the more readily achievable impact; reliable code execution needs exploitation work tailored to each application and JVM. There’s no single universal exploit.
Am I affected? Three conditions
You are only exposed if all three are true.
1. You run an affected Java version
The OpenJDK risk matrix marks CVE-2026-114938 against JDK 17, 21, 25 and 27, but not 8 or 11. Datadog lists these ranges and first fixed releases:
| Java line | Affected | First fixed |
|---|---|---|
| 17 | 17.0.6 up to before 17.0.21.1 | 17.0.21.1 |
| 21 | All before 21.0.13.1 | 21.0.13.1 |
| 25 | All before 25.0.5.1 | 25.0.5.1 |
| 27 | All before 27.0.1.1 | 27.0.1.1 |
The OpenJDK matrix scores it 8.1 under CVSS 3.1, while Datadog reports a 9.2 (Critical) rating under CVSS 4.0. Note that the same advisory fixes nine other CVEs, some of which do affect JDK 8 and 11, so update those too.
2. Your CPU supports AVX-512 VBMI
The vulnerable path only runs on x86-64 processors with AVX-512 VBMI. Native ARM64 JVMs (for example on AWS Graviton or Apple silicon) don’t execute it. On Linux, check with:
grep -om1 -E 'avx512[_]?vbmi' /proc/cpuinfo
No output suggests the CPU lacks VBMI. Output of avx512vbmi or avx512_vbmi means it may be vulnerable. In the cloud, check each instance type you use, as different families have different CPUs.
3. Attacker-controlled data reaches the affected decoder
In the build Datadog tested, the AVX-512 path handles Base64.getDecoder() and Base64.getUrlDecoder(), while Base64.getMimeDecoder() bypasses it. Think about where your code decodes untrusted Base64: JWTs, Basic auth headers, SAML messages, webhook payloads, file uploads. Libraries that implement their own decoding behave differently, so check your dependencies too.
// Potentially exposed on an affected JDK + CPU:
byte[] data = Base64.getDecoder().decode(untrustedInput);
byte[] token = Base64.getUrlDecoder().decode(jwtPart);
How to fix it
Step 1: Install a fixed runtime
Get a build at or above the fixed version from your vendor (Oracle, Eclipse Temurin, Amazon Corretto, Microsoft Build of OpenJDK, Red Hat and others publish their own builds). Then check what’s actually installed:
java -version
Step 2: Rebuild container images
Patching the host does nothing for a JDK baked into an image. Update the base image tag, rebuild and redeploy:
# Use a base image tag that resolves to a fixed JDK build (verify with java -version)
FROM eclipse-temurin:21-jre
# then rebuild: docker build --pull -t myapp:patched .
Using --pull makes sure Docker fetches the latest base image instead of a cached one. Also look for runtimes bundled inside applications (IDEs, build tools, vendor appliances).
Step 3: Restart every JVM
A running process keeps the old runtime until it restarts. Check the running process rather than the java on your shell path:
jcmd <PID> VM.version
Can’t patch today? Temporary mitigations
Datadog confirmed two JVM startup options that prevented the out-of-bounds writes in its tests.
Option A (narrower, preferred): disable the Base64 intrinsics.
java -XX:-UseBASE64Intrinsics -jar app.jar
Option B: limit the JVM to AVX2 on x86-64.
java -XX:UseAVX=2 -jar app.jar
Option B affects every operation that uses AVX-512, so measure the performance impact. Datadog also warns: only apply UseAVX=2 on x86 hosts. ARM64 JVMs don’t recognise the flag and will fail to start, which is a real risk if you set it in shared configuration like JAVA_TOOL_OPTIONS across mixed fleets.
To roll out Option A through an environment variable (for example in Kubernetes):
env:
- name: JAVA_TOOL_OPTIONS
value: "-XX:-UseBASE64Intrinsics"
Then confirm it took effect on the running process:
jcmd <PID> VM.flags -all | grep -E 'UseBASE64Intrinsics|UseAVX'
You should see UseBASE64Intrinsics = false (or UseAVX = 2).
Defensive coding helps, but isn’t a fix
Rejecting obviously malformed input before decoding reduces exposure, but don’t rely on it as your mitigation, since the bug lives inside the JDK:
import java.util.Base64;
import java.util.regex.Pattern;
final class SafeB64 {
private static final Pattern STD =
Pattern.compile("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$");
static byte[] decode(String s) {
if (s.length() > 64_000 || !STD.matcher(s).matches()) {
throw new IllegalArgumentException("invalid base64");
}
return Base64.getDecoder().decode(s);
}
}
This strict pattern rejects strings like AAAA...A= whose padding can’t form a valid group. Patch the runtime regardless.
A prioritisation checklist
- Inventory Java services, their JDK versions and CPU architectures.
- Prioritise internet-facing services on x86-64 hosts with AVX-512 VBMI running JDK 17+.
- Patch, rebuild images with
--pulland restart. - Where patching must wait, apply
-XX:-UseBASE64Intrinsicsand verify withjcmd. - Patch JDK 8 and 11 too, for the other CVEs in the same advisory.
Key takeaways
- CVE-2026-114938 (“Java4Shell”) is an out-of-bounds write in OpenJDK’s AVX-512 Base64 decoder, affecting JDK 17, 21, 25 and 27.
- Exposure requires an affected JDK, an AVX-512 VBMI CPU and untrusted input reaching
getDecoder()/getUrlDecoder(). - Fix: upgrade to 17.0.21.1, 21.0.13.1, 25.0.5.1 or 27.0.1.1 (or later), rebuild images and restart.
- Stopgap:
-XX:-UseBASE64Intrinsics, verified withjcmd.
Read the OpenJDK advisory and Datadog’s full analysis for more detail.
