Java4Shell (CVE-2026-114938): JVM Base64 Flaw, Detection, Fix
Java4Shell is a heap overflow in the OpenJDK Base64 decoder on AVX-512 CPUs. How the masked store goes wrong, which systems are exposed, how to check and fix.
Zyberum Security Team · Published · 13 min read
Java4Shell, also called Java2Shell, is a memory corruption bug in the Java virtual machine itself. The hand-written AVX-512 routine that HotSpot uses to decode Base64 writes 64 bytes past the end of a Java array when the input ends in a malformed padding. Base64 is decoded before authentication in almost every Java web application: in Authorization headers, tokens and cookies. The researchers at Calif showed code execution without login against several widely used products in their default configuration.
It was disclosed on 17 November 2026 together with the Oracle patch update. As of this writing there are no reports of attacks in the wild, crashing an affected service is easy, and reliable code execution is difficult and specific to each application. This guide is part of our series on the 2Shell vulnerabilities.
The facts in one table
| Identifier | CVE-2026-114938 |
| Component | OpenJDK HotSpot, Base64 decode intrinsic for AVX-512 VBMI |
| Class | Out-of-bounds write on the Java heap |
| Score | Calif: CVSS 4.0 9.2. Oracle: CVSS 3.1 8.1, AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H. Red Hat: critical |
| Affected | OpenJDK 17.0.6 and later, 21, 25, 27 and all builds derived from them (Oracle Java SE, Temurin, Corretto, Zulu, Liberica, SapMachine, Microsoft, Red Hat, GraalVM), plus the Oracle Java 8 Enterprise Performance Pack |
| Fixed | 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1, 8u513-perf |
| No fix | 18 to 20, 22 to 24 and 26: these lines are out of support |
| Not affected | Standard Java 8 and 11, ARM64, x86-64 CPUs without AVX-512 VBMI |
| Authentication | None, if the application decodes Base64 before login |
| Exploited in the wild | Not reported as of 19 November 2026 |
Which systems are exposed?
Five conditions must all be true. If one is missing, the vulnerable instructions are never executed.
- Step 1/6The runtime is an affected build: OpenJDK 17.0.6 or later, 21, 25 or 27 before the November 2026 fix.
- Step 2/6The processor supports AVX-512 VBMI: Intel Ice Lake, Sapphire Rapids and newer, AMD Zen 4 and newer. Most current cloud instances on x86 qualify.
- Step 3/6The JVM runs with its defaults:
UseAVX=3andUseBASE64Intrinsics=true. - Step 4/6The decoder is hot. After enough calls the JIT compiler replaces the Java loop with the assembly routine. On a busy service this happens within minutes.
- Step 5/6The application decodes Base64 that a client controls. Basic authentication alone is enough.
- Step 6/6Interim measure:
-XX:-UseBASE64Intrinsicsremoves the assembly routine. The decoder falls back to the Java loop, which checks its bounds.
Calif demonstrated code execution without authentication against Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate in default configuration, and after authentication against Kafka, Solr, Elasticsearch, Gerrit and Spinnaker. Wiz reports its own proof of concept against Jenkins, Confluence and Tomcat. The list is not complete: the precondition is a property of the platform, not of these products.
How does Java4Shell work?
The assembly routine computes how many bytes it will write, and a malformed ending makes that number negative. The instruction that turns the number into a write mask reads the negative value as “all 64 bytes”.
For speed, HotSpot replaces java.util.Base64.Decoder with a routine written in AVX-512 assembly (generate_base64_decodeBlock in the stub generator). It processes 64 input characters at a time and stores the result with a masked 64-byte store, where the mask selects how many bytes are really written.
- Step 1/5The application decodes a header value. For an input of 64 characters plus padding, Java allocates an output array of 50 bytes. Other objects follow directly behind it on the heap.
- Step 2/5The routine computes the output length as
(len / 4) * 3and subtracts one for every=. Nothing stops the result from dropping below zero on a malformed ending. - Step 3/5The mask is built with
BZHI, which looks only at the low eight bits. A length of minus one counts as 255: all 64 mask bits are set. - Step 4/5The masked store
VMOVDQU8writes a full 64 bytes, starting at offset 48 of a 50-byte array. 62 bytes land in the neighbouring object. - Step 5/5Only now does Java validate the input and throw
IllegalArgumentException. The application logs a harmless-looking error. The heap is already corrupted.
From overflow to code execution
The write is constrained: according to Calif the first byte is fully controlled, the second partly, and the rest is fixed. That is enough to change the length field of a neighbouring array. An array that believes it is longer than it is gives a wider read and write, a second corrupted array discloses heap contents, and from there the researchers reach the JVM’s code cache. The chain needs a prepared heap layout, repeated attempts and work per application, which is why Oracle rates the attack complexity as high. Calif has not published the application-specific steps.
A crash needs none of that. VulnCheck describes denial of service as trivial: a burst of requests reliably brought a service down.
- Step 1/5The request needs no session. A long Base64 value with a broken ending in the
Authorizationheader is enough. - Step 2/5The framework decodes the header before it checks any credentials.
- Step 3/5The JIT-compiled assembly routine runs and writes past the array.
- Step 4/5The decoder reports invalid input. The application answers with 400 or 401, as it would for any wrong password.
- Step 5/5The damage shows later: the garbage collector trips over the corrupted object and the JVM crashes, or a prepared heap gives the attacker control.
What the patch changed
The fix sends every ending that is shorter than a full block of four characters to the plain Java implementation. The assembly routine no longer sees a malformed tail, and the length can no longer drop below zero.
How to identify Java4Shell
Inventory every Java runtime, including the bundled ones, then check the processor and the flags of the running processes. Version numbers of your application do not help.
1. Find every JVM
# Running JVMs with their binaries
ps -eo pid,user,cmd | grep -E '[j]ava( |$)|/bin/java'
for p in $(pgrep -f java); do echo "== $p $(readlink /proc/$p/exe)"; jcmd $p VM.version 2>/dev/null | tail -2; done
# Every java binary on the host, including bundled runtimes
find / -xdev -type f -name java -perm -u+x 2>/dev/null | while read j; do echo "$j: $("$j" -version 2>&1 | head -1)"; done
# Containers
docker ps --format '{{.Names}}' | xargs -I{} sh -c 'echo {}; docker exec {} sh -c "java -version 2>&1 | head -1" 2>/dev/null'
Affected are builds from 17.0.6 up to, but not including, 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Temurin publishes the fixed builds as 17.0.21.1+2, 21.0.13.1+2, 25.0.5.1+2 and 27.0.1.1+4.
The runtimes that get forgotten are the ones that come with a product: Keycloak, Jira, Confluence, Artifactory, Jenkins, Elasticsearch, Kafka and many appliances bring their own JRE. An operating system update does not touch them. Software composition scanners list the finding under the CVE id for the JDK in an image.
2. Check the processor
grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'
Four lines of output mean the hardware path exists. In a cloud, check the instance and not the documentation: the same instance family can run on different CPU generations, and a virtual machine can move.
3. Check the flags of the running process
jcmd <pid> VM.flags -all | grep -E 'UseBASE64Intrinsics|UseAVX '
java -XX:+PrintFlagsFinal -version 2>/dev/null | grep -E 'UseBASE64Intrinsics|UseAVX '
UseBASE64Intrinsics = true together with UseAVX = 3 on an affected build is the exposed combination.
4. Look for traces
| Where | Indicator |
|---|---|
JVM working directory, /tmp, log directory | New hs_err_pid<pid>.log crash files since 17 November 2026 |
| Service supervision | Unexplained JVM restarts, SIGSEGV, crashes inside garbage collector threads |
| Proxy and application logs | Very long Authorization values, tokens or cookies that consist of a repeated character and end in =, answered with 400 or 401 |
| Request patterns | Bursts of such requests against login endpoints, repeated after each restart |
find / -xdev -name 'hs_err_pid*.log' -newermt '2026-11-17' 2>/dev/null
journalctl --since '2026-11-17' | grep -i -E 'SIGSEGV|hs_err_pid|A fatal error has been detected by the Java Runtime'
VulnCheck provides Snort, Suricata, Sigma and YARA rules to its customers, and Semgrep has published detection scripts. Wiz points out the limit of network filters: valid and malicious inputs look alike, and the decisive part is a few characters at the end.
What to do
Replace the runtime everywhere. Until that is done, switch off the routine with a JVM flag and verify that the flag has arrived in the process.
- Update every JDK and JRE to 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1 or the fixed build of your vendor. Lines 18 to 20, 22 to 24 and 26 get no fix: move to a supported line.
- Update products with a bundled runtime through their vendors, or replace the bundled JRE where the vendor supports that. Identity providers first: a compromised Keycloak or PingFederate opens everything behind it.
- Rebuild container images on a fixed base image and redeploy. Check the running digest.
- Restart. A JVM does not pick up a new runtime while it runs.
- Prioritise internet-facing services on x86-64 that authenticate users: single sign-on, artifact repositories, CI servers, wikis and ticket systems.
The interim flags
# Preferred: switch off only the Base64 routine
export JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics"
# Alternative on x86-64: no AVX-512 code at all
export JAVA_TOOL_OPTIONS="-XX:UseAVX=2"
# Verify in the running process
jcmd <pid> VM.flags -all | grep -F UseBASE64Intrinsics # expected: = false
| Point | Detail |
|---|---|
| Where to set it | JAVA_TOOL_OPTIONS or JDK_JAVA_OPTIONS reach JVMs whose start command you do not control. In Kubernetes, set the variable in the pod specification |
| Every node | Red Hat stresses failover and standby nodes, and for Keycloak the operator’s own JVM |
UseAVX=2 | Only on x86-64. A JVM on ARM64 refuses to start with this option |
| Cost | Base64 decoding loses its hardware acceleration; UseAVX=2 also slows other vectorised code. The vendors give no figures |
| Status | Not an officially supported workaround of Oracle and not a fix. Remove it after the update |
| Disagreement | Blackpoint Cyber reports that the flags did not stop the corruption in its tests. Verify on your systems and do not postpone the update because of the flag |
Hardening that limits the damage
- Put a strict proxy in front. Limit header sizes at the reverse proxy. That does not close the flaw, but removes the comfortable input sizes and makes anomalies visible.
- Isolate the identity provider. Own hosts or nodes, no shared secrets with other services, tight egress rules.
- Run the JVM without privileges and in a container with a read-only filesystem and dropped capabilities.
- Alert on JVM crashes. A
hs_err_pidfile on a login service is a security event until it is explained. - Keep a queryable inventory of runtimes. The question “where does Java 17 to 27 run on x86” should take minutes.
What it means for a penetration test
A flaw in the runtime does not show up in a code review of the application and not in its dependency list. In a web application penetration test we therefore record the platform as well: runtime build, processor features where they matter, start flags, bundled components. For this vulnerability we check exposure through versions, flags and configuration. We do not send triggering inputs to production systems, because the first visible effect of a hit is a crashed service.
FAQ
Frequently asked questions
Is Java 8 or Java 11 affected by Java4Shell?
No, with one exception. The vulnerable assembly routine was introduced in OpenJDK 17.0.6. Standard Java 8 and Java 11 do not contain it. The exception is the Oracle Java 8 Enterprise Performance Pack, which carries the routine and is fixed in 8u513-perf.
Do we have to update Spring, Tomcat or our application?
No. The flaw is in the Java runtime, not in a library. No update of Spring, Tomcat or Jetty fixes it. What has to be replaced is every JDK and JRE, including the ones bundled inside products and container images.
Our servers run on ARM. Are we safe?
Yes, for this flaw. The routine exists only for x86-64 processors with AVX-512 VBMI. ARM64 systems such as AWS Graviton do not have this code path. Update anyway: a workload can move to other hardware, and the November release fixes other issues too.
Is the JVM flag a replacement for the update?
No. Red Hat, Calif, JFrog and VulnCheck report that disabling the Base64 intrinsic stops the overflow. Blackpoint Cyber reports that the flags did not stop the corruption in its tests. Treat the flag as a bridge until the update and verify it on your own systems.