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

Source: https://zyberum.com/insights/java4shell-cve-2026-114938 · Updated: 2026-11-19

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](/insights/2shell-vulnerabilities-overview).

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

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.

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

### 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

```bash
# 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

```bash
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

```bash
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 |

```bash
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.

1. **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.
2. **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.
3. **Rebuild container images** on a fixed base image and redeploy. Check the running digest.
4. **Restart.** A JVM does not pick up a new runtime while it runs.
5. **Prioritise** internet-facing services on x86-64 that authenticate users: single sign-on, artifact repositories, CI servers, wikis and ticket systems.

### The interim flags

```bash
# Preferred: switch off only the Base64 routine

# Alternative on x86-64: no AVX-512 code at all

# 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_pid` file 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](/web-application-pentest) 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

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

## Sources

- [Calif: Java4Shell write-up](https://calif.io/java4shell)
- [Red Hat Security Bulletin RHSB-2026-018](https://access.redhat.com/security/vulnerabilities/RHSB-2026-018)
- [JFrog Security Research: Java4Shell vulnerability](https://research.jfrog.com/post/java4shell-vulnerability/)
- [Eclipse Adoptium: Temurin November 2026 releases and Java4Shell](https://adoptium.net/news/2026/11/temurin-november-2026-cspu-java4shell)
- [VulnCheck: Java4Shell](https://www.vulncheck.com/blog/java4shell)
- [Wiz: CVE-2026-114938, RCE in OpenJDK](https://www.wiz.io/blog/cve-2026-114938-rce-java4shell-openjdk)
- [Semgrep: Java4Shell OpenJDK Base64 vulnerability](https://semgrep.dev/blog/2026/java4shell-openjdk-base64-vulnerability/)
- [Blackpoint Cyber: Java4Shell, Java Base64 decoder flaw](https://blackpointcyber.com/blog/java4shell-cve-2026-114938-java-base64-decoder-flaw/)
- [Oracle Critical Patch Update Advisory, November 2026](https://www.oracle.com/security-alerts/cspunov2026.html)

## Related

- [The 2Shell Vulnerabilities: React, PHP, Brotli, Java, NGINX, Ruby](https://zyberum.com/insights/2shell-vulnerabilities-overview)
- [PHP2Shell (CVE-2026-109618/109619): Analysis, Detection, Fix](https://zyberum.com/insights/php2shell-cve-2026-109618)
- [NGINX2Shell (CVE-2026-123007): nginx HTTP/2 Flaws, Detection, Fix](https://zyberum.com/insights/nginx2shell-cve-2026-123007)
- [CVE](https://zyberum.com/glossary/cve)
- [Vulnerability Management: A Process That Works in Practice](https://zyberum.com/insights/vulnerability-management-process)
- [Your web app has a login. We check what is behind it.](https://zyberum.com/web-application-pentest)

---
Zyberum GmbH. Canonical page: https://zyberum.com/insights/java4shell-cve-2026-114938
