Security

Java2Shell Checker

A short Base64 string can make Java write past the end of an array on servers with AVX-512 processors (CVE-2026-114938, called Java2Shell or Java4Shell, fixed November 17, 2026). Paste the output of the commands below to see where this machine stands.

Run where the Java service runs and paste the output (read-only)java -version 2>&1uname -mecho "cpu flags: $(grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -xE 'avx512f|avx512bw|avx512vbmi|bmi2' | sort -u | tr '\n' ' ')"for p in $(pgrep java); do jcmd $p VM.flags 2>/dev/null | tr ' ' '\n' | grep -E 'UseAVX|UseBASE64Intrinsics'; done
Paste the command output

Paste at least the java -version output. The cpu flags line tells whether this machine can trigger the bug.

Fix: update Java and restart every JVM

Install the fixed runtime from your distribution or vendor, rebuild container images on a fixed base, then restart. A running JVM keeps the old code until it restarts.

sudo apt-get update && sudo apt-get install --only-upgrade 'openjdk-*' # Debian, Ubuntusudo dnf upgrade 'java-*-openjdk*' # RHEL, AlmaLinux, Rockydocker pull eclipse-temurin:21-jre # containers: rebuild on a fixed base image, then redeployjava -version 2>&1
If you can't update yet: turn off the Base64 intrinsic

Only on x86-64 JVMs. Base64 decoding gets slower; nothing else changes. Restart the service to apply and confirm with jcmd.

export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -XX:-UseBASE64Intrinsics" # or add the flag to the service's JVM optionssudo systemctl restart <your-java-service>jcmd <pid> VM.flags | tr ' ' '\n' | grep BASE64 # shows -XX:-UseBASE64Intrinsics

Look for recent JVM crash logs (a failed attempt may leave one, but not always):

sudo find / -xdev -name 'hs_err_pid*.log' -mtime -14 2>/dev/null
First fixed updates
Java 1717.0.21.1
Java 2121.0.13.1
Java 2525.0.5.1
Java 2727.0.1.1
Java 18, 19, 20, 22, 23, 24, 26no fix, move to a supported line

Checked in your browser. What you paste is never uploaded.

How to use

  1. Read the first section below: it explains in plain words how a short Base64 string makes Java write past the end of an array.
  2. On the server or inside the container that runs the Java service, run the four read-only commands next to the box and paste the output. The CPU check matters: the bug only exists on processors with AVX-512 VBMI.
  3. Read the verdict: Exposed, Unpatched, No fix for this version, Safe on this CPU, Workaround on, Patched or Not affected.
  4. Update the Java runtime and restart every JVM. If you can't update today, turn off the vulnerable intrinsic with -XX:-UseBASE64Intrinsics and restart.

What causes Java2Shell (CVE-2026-114938), in plain words

Java decodes Base64 everywhere: Basic auth headers, JWT tokens, SAML messages, API fields. To make that fast, HotSpot replaces java.util.Base64 decoding with hand-written machine code (an intrinsic) once the code is hot. On recent x86-64 processors it uses AVX-512 instructions that store 64 bytes in one go, with a mask that says which of the 64 bytes may really be written.

For a malformed input with padding at the end, such as 64 letters followed by a single =, the expected output length works out to -1. The instruction that builds the mask only looks at the lowest 8 bits of that number, and -1 in 8 bits is 255: every mask bit is set. The store then writes all 64 bytes, up to 62 bytes past the end of the output array, before Java notices the input is invalid and throws an exception. The damage to memory has already been done.

Think of a parking attendant told to fill "minus one" spaces whose counter can only show 0 to 255: it reads 255 and waves the whole convoy in, past the end of the lot. Attackers who control what lands next to the array can turn those extra bytes into running their own code.

Who is affected

All of these must be true: a HotSpot JVM (OpenJDK, Oracle, Temurin, Corretto, Zulu and most others) from an affected update; a 64-bit x86 processor with avx512f, avx512bw, avx512vbmi and bmi2, which means Intel Xeon Ice Lake or newer, or AMD Zen 4 or newer; the intrinsic turned on (the default); and attacker-controlled Base64 reaching java.util.Base64 after the code has warmed up, which a busy service does within minutes.

It counts as pre-auth when the server decodes Base64 before checking the login, as with a Basic auth header or a JWT. Researchers at Calif reported pre-auth code execution against default setups of Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate; those exploits are not public.

Not affected: ARM64 (AWS Graviton, Apple silicon), 32-bit x86, x86 processors without AVX-512 VBMI (Skylake and Cascade Lake servers, most desktops before 2021), Eclipse OpenJ9, and standard Java 8 and 11 builds. The one Java 8 exception is Oracle Java 8 Enterprise Performance Pack 8u511b33-perf, fixed in 8u513-perf.

The same container image can be safe on one cloud host and vulnerable on the next, so check the CPU where the service actually runs, and patch anyway.

Fixed versions

Oracle's November 17, 2026 Critical Patch Update and the matching OpenJDK builds fix it. Vendors use their own build suffixes on the same numbers: Temurin 21.0.13.1+2, Corretto 17.0.21.1.2. Java 17.0.0 to 17.0.5 predate the bug. Java 18, 19, 20, 22, 23, 24, 26 got no fix: move to a supported line.

Java lineFirst fixed update
Java 1717.0.21.1
Java 2121.0.13.1
Java 2525.0.5.1
Java 2727.0.1.1

Ways to protect a service

Update and restart: install the fixed runtime (apt, dnf, or a new base image for containers) and restart every JVM. A running JVM keeps the old machine code until it restarts. Applications that bundle their own Java, such as IDEs, Elasticsearch or vendor appliances, need their own update.

Turn off the intrinsic if you can't update yet: add -XX:-UseBASE64Intrinsics to the JVM options (or JAVA_TOOL_OPTIONS) and restart. Base64 decoding gets slower; nothing else changes. -XX:UseAVX=2 also works but slows other code. Use these flags only on x86-64 JVMs and confirm with jcmd <pid> VM.flags.

Watch out for fake exploit repositories: several GitHub projects named after Java2Shell are lures that install malware.

Was I attacked?

A failed attempt can crash the JVM and leave an hs_err_pid file, but one lab saw the server answer 401 without crashing, so a missing crash log is not proof of safety. Scanning for the public trigger string was seen in the wild; no successful intrusion had been confirmed by November 21, 2026, and the CVE was not in CISA's Known Exploited Vulnerabilities catalog.

Timeline

Date (2026)Event
November 17Oracle Critical Patch Update and OpenJDK builds 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1; Calif names the bug Java4Shell (also called Java2Shell)
November 18Temurin builds and public lab write-ups with the crash trigger
November 19Red Hat ships fixed RHEL packages

Frequently asked questions

Is it Java2Shell or Java4Shell?

Both names refer to the same bug, CVE-2026-114938. Early posts called it Java2Shell; the researchers' name is Java4Shell, a nod to Log4Shell. It is a bug in the JVM itself, not in a library like Log4j.

How do I know if my CPU has AVX-512 VBMI?

On Linux run grep -o avx512vbmi /proc/cpuinfo | head -n1, or use the third check command. No output means the CPU lacks it and this bug can't trigger there. In the cloud, check the instance type: many older and burstable types and all Graviton types lack AVX-512.

Are Java 8 and Java 11 affected?

Standard Java 8 and 11 builds are not. The vulnerable AVX-512 decoder arrived in Java 17.0.6. The only Java 8 build affected is Oracle's Enterprise Performance Pack 8u511b33-perf.

Is what I paste uploaded?

No. The check runs in your browser and nothing you paste leaves your device.

Found a problem or have an idea? Report a problem

Share

You might also like