Java4Shell: The Critical Base64 Bug in Java (CVE-2026-114938)
On November 17, 2026, a critical bug in Java's Base64 decoder was made public. It is called Java4Shell (CVE-2026-114938), and it can let an attacker who sends specially crafted Base64 text corrupt memory inside a running Java program, with no login needed. Base64 is everywhere in Java applications: tokens, HTTP headers, file uploads and APIs all use it. This page explains the bug in plain words, shows you how to check your own machines, and lists exactly what to do, with a link to the source of every fact.
What Happened
The Canadian Centre for Cyber Security published alert AL26-029 on November 17, 2026. It describes a heap-based buffer overflow (CWE-122) that "affects the Base64 standard Java library."
| Fact | What the sources say |
|---|---|
| Name | Java4Shell, CVE-2026-114938 (CVE record) |
| Kind of bug | Heap-based buffer overflow: the program writes past the end of an array |
| Where | The hardware-accelerated Base64 decoder in the HotSpot JVM, used by java.util.Base64 |
| Who can attack | Anyone who can send data to the program; the alert says it can be exploited "remotely without authentication" |
| Hardware needed | x86-64 processors with AVX-512 VBMI instructions |
| Possible damage | "memory corruption, disclosure of sensitive information, process crashes or arbitrary code execution" (alert AL26-029) |
| Severity | 9.2 out of 10, Critical (CVSS 4.0), as published by the researchers; the alert itself gives no score |
| Attacks seen so far | "The Cyber Centre is not aware of active exploitation at this time, but that can change quickly." (November 17, 2026) |
The bug was found and disclosed by Calif Research, who published a technical write-up the same day. Like many of the worst bugs, it sits in code that almost every Java application uses without thinking about it.
How the Bug Works
You don't need to understand the machine code to understand the risk. Here is the idea in five steps.
- Java has two versions of the Base64 decoder. The normal one is written in Java. For speed, the JVM's JIT compiler replaces it with a hand-tuned native version (an intrinsic) once the decoder has been called many times. On x86-64 processors with AVX-512 VBMI, that native version decodes 64 bytes at a time.
- The bug is in how that fast version handles the
=padding at the end of Base64 text. According to the researchers, certain endings make a length counter go below zero, and the fast path then writes a full 64-byte block instead of stopping. - The extra bytes land past the end of the output array, on top of whatever the JVM stored next to it. That is memory corruption, and a skilled attacker can sometimes turn it into running their own code.
Two details make this serious. The bug is in the standard library, so your code doesn't need to do anything unusual: calling Base64.getDecoder().decode(...) on text from outside is enough. And Base64 decoding often happens before any login check, for example when a server reads a token or an Authorization header.
Who Is Affected
A machine is exposed only when all three of these are true.
The Processor
The fast Base64 path only exists on x86-64 processors with AVX-512 VBMI. The researchers name Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids, and AMD EPYC and Ryzen from Zen 4 onward. They state that ARM64 processors are not affected. Many cloud servers use exactly these x86-64 chips, so don't assume you are safe because you never chose AVX-512 yourself.
The Java Version
The researchers say the bug affects OpenJDK from version 17.0.6 onward, which means almost every modern build until the November 17, 2026 fixes, from every vendor that ships OpenJDK: Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine, Red Hat OpenJDK, Oracle OpenJDK, Oracle Java SE and Oracle GraalVM for JDK.
Alert AL26-029 lists these Oracle builds as affected:
| Product | Affected versions (alert AL26-029) |
|---|---|
| Oracle Java SE 8 | 8u511b33-perf |
| Oracle Java SE 17 | 17.0.21.0.3 |
| Oracle Java SE 21 | 21.0.13.0.3 |
| Oracle Java SE 25 | 25.0.5.0.3 |
| Oracle Java SE 27 | 27.0.1.0.3 |
| Oracle GraalVM for JDK | 17.0.21.0.3, 21.0.13.0.3 |
| Oracle GraalVM Enterprise Edition | 21.3.20.0.3 |
Neither the alert nor the researchers list the fixed build numbers; both point to the vendors. Oracle's fixes are in the Critical Security Patch Update Advisory, November 2026, and OpenJDK's in its November 17, 2026 vulnerability advisory. If you use another vendor's build, check that vendor's security page for its November 2026 release.
The Input
Ask one question: can text from outside reach a Base64 decoder? For most server applications the honest answer is yes, even if your own code never calls Base64. Web frameworks decode Basic authentication headers, security libraries decode tokens, and many APIs carry files and images as Base64 inside JSON.
Check Your Own Machine
Step 1: Check the Processor
On Linux, the alert suggests this command. If it prints nothing, the processor has no AVX-512 at all:
lscpu | grep avx512The researchers give a stricter check that looks for the four exact features the fast path needs. The machine is exposed only if all four appear:
grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' \
| grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'Step 2: Check Java from the Inside
This program prints the Java build, the processor architecture, and whether the fast Base64 path and AVX-512 support are switched on in the running JVM. It uses HotSpotDiagnosticMXBean, which can read any JVM option by name.
import com.sun.management.HotSpotDiagnosticMXBean;
import java.lang.management.ManagementFactory;
public class Java4ShellCheck {
public static void main(String[] args) {
HotSpotDiagnosticMXBean vm = ManagementFactory
.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
System.out.println("Java version: " + Runtime.version());
System.out.println("Vendor: "
+ System.getProperty("java.vendor"));
System.out.println("CPU arch: " + System.getProperty("os.arch"));
System.out.println("Base64 fast path (UseBASE64Intrinsics): "
+ option(vm, "UseBASE64Intrinsics"));
System.out.println("AVX level (UseAVX, x86-64 only): "
+ option(vm, "UseAVX"));
}
static String option(HotSpotDiagnosticMXBean vm, String name) {
try {
return vm.getVMOption(name).getValue();
} catch (IllegalArgumentException e) {
return "not available on this CPU";
}
}
}Java version: 25.0.5.0.3
Vendor: Homebrew
CPU arch: aarch64
Base64 fast path (UseBASE64Intrinsics): true
AVX level (UseAVX, x86-64 only): not available on this CPUThis real output came from an Apple Silicon Mac on November 18, 2026, and it is a good lesson in itself. The build, 25.0.5.0.3, is on the affected list, but the machine is not exposed, because aarch64 is ARM: there is no AVX-512, so UseAVX doesn't even exist. On an exposed x86-64 server you would see CPU arch: amd64, the fast path true, and UseAVX set to 3, which is the level that turns on AVX-512.
How to Fix It
Updating Java is the only real fix. The Cyber Centre's list of actions, in its own order:
- Inventory your Java environments. Find every Java runtime, "including vendor, full build version."
- Update affected Java installations immediately to a fixed, supported release.
- Prioritize internet-facing systems and applications.
- Find third-party products, appliances and containers that include a vulnerable Java.
- Monitor for compromise by reviewing web server, application, authentication and endpoint logs.
- Keep watching your vendors for updates to products that bundle Java, and apply them without delay.
Containers need special care. Updating Java on the host does nothing for a container that ships its own JDK. Update the base image, rebuild, and redeploy every service that uses it.
If You Cannot Patch Today
The sources describe two JVM flags that switch off the dangerous path. They are a stopgap while you schedule the update, not a replacement for it.
| Flag | What it does | Source |
|---|---|---|
-XX:-UseBASE64Intrinsics | Turns off the fast, hardware-accelerated Base64 code, so Java uses its normal decoder | The researchers |
-XX:UseAVX=2 | Turns off AVX-512 in the JVM. x86-64 only: on ARM, Java refuses to start | Alert AL26-029 and the researchers |
You can confirm the first flag works with the check program from earlier:
import com.sun.management.HotSpotDiagnosticMXBean;
import java.lang.management.ManagementFactory;
public class Java4ShellCheck {
public static void main(String[] args) {
HotSpotDiagnosticMXBean vm = ManagementFactory
.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
System.out.println("Base64 fast path (UseBASE64Intrinsics): "
+ vm.getVMOption("UseBASE64Intrinsics").getValue());
}
}Base64 fast path (UseBASE64Intrinsics): falseThe second flag shows why you must read the "x86-64 only" warning. Here is what happens on the same Apple Silicon Mac:
java -XX:UseAVX=2 Java4ShellCheck.javaUnrecognized VM option 'UseAVX=2'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.Timeline and Sources
| When | What happened |
|---|---|
| November 17, 2026 | Calif Research disclosed Java4Shell |
| November 17, 2026, 1:00 PM PT | OpenJDK and Oracle released fixes, according to the researchers |
| November 17, 2026 | The Canadian Centre for Cyber Security published alert AL26-029; no active exploitation known at that time |
| November 18, 2026 | This page was published |
Sources used for this page:
- Alert AL26-029: Critical vulnerability impacting Oracle Java, CVE-2026-114938, Canadian Centre for Cyber Security
- Java4Shell: Write once, RCE everywhere, Calif Research
- CVE-2026-114938, CVE program
- CWE-122: Heap-based Buffer Overflow, MITRE
- Oracle Critical Security Patch Update Advisory, November 2026
- OpenJDK vulnerability advisory, November 17, 2026
This page will be updated if the sources change, for example if active attacks are reported.
Common Mistakes
| Mistake | Why it's wrong | Do this instead |
|---|---|---|
"We don't call Base64 ourselves, so we're safe" | Frameworks and security libraries decode Base64 for you, often before login | Assume untrusted Base64 reaches the decoder; patch |
| Updating Java on the host only | Containers bring their own JDK | Update base images and redeploy |
| Treating the flags as the fix | They switch off the dangerous path but leave you on an old build | Use them only until the update is installed |
Rolling out -XX:UseAVX=2 everywhere | Java won't start on ARM machines | Use it on x86-64 only, or use -XX:-UseBASE64Intrinsics |
Checking the java on your PATH | Your service may run a different installation | Check the exact runtime the service uses |
Practice
- Easy: Run
Java4ShellCheckon your own computer. Write down the Java build, the architecture and the value ofUseBASE64Intrinsics, then decide whether that machine is exposed using the three questions. - Harder: Srihitha runs a payment API in containers on x86-64 cloud servers with Sapphire Rapids processors. The base image ships Java 21.0.13.0.3, and the API reads a Base64 token from every request. List what she should do today, in order, and which flag she could use until the new image is deployed.
Key Takeaways
Was this tutorial helpful?