Java4Shell: The Critical Base64 Bug in Java (CVE-2026-114938)

Updated · 12 min read
mediumJava 25javasecuritycvejava4shellbase64critical-bug

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."

FactWhat the sources say
NameJava4Shell, CVE-2026-114938 (CVE record)
Kind of bugHeap-based buffer overflow: the program writes past the end of an array
WhereThe hardware-accelerated Base64 decoder in the HotSpot JVM, used by java.util.Base64
Who can attackAnyone who can send data to the program; the alert says it can be exploited "remotely without authentication"
Hardware neededx86-64 processors with AVX-512 VBMI instructions
Possible damage"memory corruption, disclosure of sensitive information, process crashes or arbitrary code execution" (alert AL26-029)
Severity9.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.

Java4Shell: the fast Base64 path writes past the end of the array
  1. 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.
  2. 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.
  3. 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.

Three questions decide whether a machine is exposed

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:

ProductAffected versions (alert AL26-029)
Oracle Java SE 88u511b33-perf
Oracle Java SE 1717.0.21.0.3
Oracle Java SE 2121.0.13.0.3
Oracle Java SE 2525.0.5.0.3
Oracle Java SE 2727.0.1.0.3
Oracle GraalVM for JDK17.0.21.0.3, 21.0.13.0.3
Oracle GraalVM Enterprise Edition21.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:

Terminal
lscpu | grep avx512

The 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:

Terminal
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.

Java4ShellCheck.java▶ Try it
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";
        }
    }
}
Output
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 CPU

This 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:

  1. Inventory your Java environments. Find every Java runtime, "including vendor, full build version."
  2. Update affected Java installations immediately to a fixed, supported release.
  3. Prioritize internet-facing systems and applications.
  4. Find third-party products, appliances and containers that include a vulnerable Java.
  5. Monitor for compromise by reviewing web server, application, authentication and endpoint logs.
  6. Keep watching your vendors for updates to products that bundle Java, and apply them without delay.
Find, fix, shield, watch

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.

FlagWhat it doesSource
-XX:-UseBASE64IntrinsicsTurns off the fast, hardware-accelerated Base64 code, so Java uses its normal decoderThe researchers
-XX:UseAVX=2Turns off AVX-512 in the JVM. x86-64 only: on ARM, Java refuses to startAlert AL26-029 and the researchers

You can confirm the first flag works with the check program from earlier:

Java4ShellCheck.java▶ Try it
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());
    }
}
Output
Base64 fast path (UseBASE64Intrinsics): false

The second flag shows why you must read the "x86-64 only" warning. Here is what happens on the same Apple Silicon Mac:

Terminal
java -XX:UseAVX=2 Java4ShellCheck.java
Output
Unrecognized VM option 'UseAVX=2'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Timeline and Sources

WhenWhat happened
November 17, 2026Calif Research disclosed Java4Shell
November 17, 2026, 1:00 PM PTOpenJDK and Oracle released fixes, according to the researchers
November 17, 2026The Canadian Centre for Cyber Security published alert AL26-029; no active exploitation known at that time
November 18, 2026This page was published

Sources used for this page:

This page will be updated if the sources change, for example if active attacks are reported.

Common Mistakes

MistakeWhy it's wrongDo this instead
"We don't call Base64 ourselves, so we're safe"Frameworks and security libraries decode Base64 for you, often before loginAssume untrusted Base64 reaches the decoder; patch
Updating Java on the host onlyContainers bring their own JDKUpdate base images and redeploy
Treating the flags as the fixThey switch off the dangerous path but leave you on an old buildUse them only until the update is installed
Rolling out -XX:UseAVX=2 everywhereJava won't start on ARM machinesUse it on x86-64 only, or use -XX:-UseBASE64Intrinsics
Checking the java on your PATHYour service may run a different installationCheck the exact runtime the service uses

Practice

  1. Easy: Run Java4ShellCheck on your own computer. Write down the Java build, the architecture and the value of UseBASE64Intrinsics, then decide whether that machine is exposed using the three questions.
  2. 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.

Quick check: Java4Shell

4 questions
1Which part of Java contains the Java4Shell bug?
2Which machine cannot trigger the bug?
3What is the real fix?
4Why is -XX:UseAVX=2 risky to roll out everywhere?

Key Takeaways

Was this tutorial helpful?

Lesson 566 of 579