← Blog

Java4Shell (CVE-2026-114938): how it works and how to fix it

Java4Shell lets one malformed Base64 string overflow the heap in Java 17, 21, 25 and 27 on AVX-512 servers. Learn who is at risk and how to fix it.

On 17 November 2026, Oracle and the OpenJDK project published CVE-2026-114938. Researchers call it “Java4Shell”. The fault is in the HotSpot JIT compiler, in the fast Base64 decoder that the JVM uses on x86-64 CPUs with AVX-512.

An attacker needs no account and no user action. The input is a Base64 string, and most Java web services decode Base64 before they check who the user is.

Summary

  • Fault: a heap-based buffer overflow (CWE-122) in the HotSpot compiler.
  • Score: CVSS 3.1 base score 8.1 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
  • Affected: Java 17, 21, 25 and 27 on Intel Xeon Ice Lake or newer, and AMD Zen 4 or newer. ARM64 servers are not affected.
  • Fix: the 17 November Java update. The Oracle builds are 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1.
  • Temporary mitigation: one JVM flag turns off the fast decoder. Use it until you can install the update.
  • Status on 18 November: there are no public reports of attacks. CISA has not added the CVE to its Known Exploited Vulnerabilities catalog.

Who is at risk

A server is at risk when all three conditions are true.

  1. The JVM version is affected. The table below gives the versions.
  2. The CPU supports AVX-512 VBMI. This includes Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids, and AMD EPYC Zen 4 and newer. On AWS, the m6i, m7i and m7a instance families have these CPUs. Older x86 CPUs (Skylake-SP, Cascade Lake, AMD Zen 3 and older) do not have VBMI. ARM64 CPUs (AWS Graviton, Ampere, Apple silicon) do not use this code.
  3. The application decodes untrusted Base64 with java.util.Base64. Researchers name HTTP Basic authentication in Tomcat, Spring Security and Keycloak, some JSON Web Token libraries, and SASL/SCRAM in Kafka. All of these decode Base64 before login.

A container uses the CPU of its host. Do the CPU check on the host.

Java line Affected builds Oracle build with the fix
8 Only the Enterprise Performance Pack (8u511b33-perf), which ships a newer JVM 8u513 or later
11 Not affected No action for this CVE
17 17.0.6 to 17.0.21.0.3 17.0.21.1
21 Up to 21.0.13.0.3 21.0.13.1
25 Up to 25.0.5.0.3 25.0.5.1
27 Up to 27.0.1.0.3 27.0.1.1

Oracle GraalVM for JDK 17 and 21, and GraalVM Enterprise Edition 21.3.20.0.3, are also affected. Java 18, 19, 20, 22, 23, 24 and 26 have the same code and get no fix. Move services on these versions to a supported Java line.

How the attack works

Java first runs a method in an interpreter. When the method runs many times, the C2 compiler makes machine code for it. For some core methods, C2 uses a hand-written assembly routine in place of the Java code. This routine is an “intrinsic”. The Base64 decoder is one of these methods. On CPUs with AVX-512 VBMI, its intrinsic decodes 64 characters at a time.

The intrinsic does not get the length of the output array. It uses a length that the Java code calculates first. When the input ends in a short block with = or == padding, that calculation underflows. The intrinsic then writes 62 or 63 bytes past the end of the output array on the heap.

After the write, the Java code finds the bad padding and throws IllegalArgumentException. The application logs a normal “invalid Base64” error. The heap is already corrupt.

The attack has four steps.

  1. The decoder becomes “hot”. On a busy server, normal traffic does this. An attacker can also send valid Base64 many times.
  2. C2 compiles the decoder and uses the AVX-512 intrinsic.
  3. The attacker sends one malformed Base64 string. The string ends in =, and its length is not a multiple of 4.
  4. The intrinsic writes past the output array, into the next object on the heap.

What an attacker can do

The bytes that the intrinsic writes are a fixed pattern. The attacker cannot choose them. The attacker can choose the input, and with it the location of the write.

  • Crash the JVM. Harness reproduced a crash in the G1 garbage collector over HTTP Basic authentication. Their test used a small, fixed TLAB size. With default heap settings, the write often lands in unused memory and causes no visible effect.
  • Run code. Calif, the team that found the bug, reports working remote code execution chains against Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate. Calif has not published these chains. Wiz reports that it built a proof of concept, and names Jenkins, Confluence and Tomcat as targets.

No independent lab has published code execution yet. Plan for it anyway. The researchers who found the bug report working chains, and code to crash a JVM is already public.

What to do

Do these steps in this order. Start with servers that accept traffic from the internet and with login services.

1. Find exposed servers

  1. List every service that runs Java 17 or later. Include build agents and products that ship their own Java runtime, such as Jenkins, Jira, Confluence, Keycloak, Kafka and Elasticsearch.
  2. On each host, check the CPU. If this command prints exposed, the CPU has the affected feature:
grep -qw avx512vbmi /proc/cpuinfo && echo exposed
  1. On each running JVM, check the version:
jcmd <pid> VM.version

2. Install the update

  1. For Oracle JDK, install the build from the table above.
  2. For other builds (Eclipse Temurin, Amazon Corretto, Azul Zulu, Microsoft, Red Hat and Linux distribution packages), install the vendor’s November 2026 security update. Each vendor publishes on its own schedule. Do not assume that its version numbers are the same as Oracle’s.
  3. For products that ship their own Java runtime, get the update from the product vendor.
  4. Rebuild your container images and deploy them again. A restart of an old image keeps the old JVM.

3. If you cannot patch today

Add these options to the JVM. They turn off only the fast Base64 decoder:

-XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_base64_decodeBlock

If your platform does not accept diagnostic options, use this option. It turns off the fast Base64 encoder and decoder:

-XX:-UseBASE64Intrinsics

To set the option for all JVMs on a host without a change to launch scripts, use the JAVA_TOOL_OPTIONS environment variable. Restart the JVM after you set it. Make sure that the option is active:

jcmd <pid> VM.flags

CAUTION: Base64 decoding becomes slower. Measure the effect on services that decode a large volume of Base64.

The last option is -XX:UseAVX=2. It also stops the overflow.

CAUTION: -XX:UseAVX=2 turns off all AVX-512 code in the JVM. Other work can become slower too. Use it only if the two options above are not available.

Remove these options after you install the update. The update fixes the fault, and the options then only cost performance.

4. Filter at the edge

Valid Base64 with padding always has a length that is a multiple of 4. Add a rule to your web application firewall or proxy. The rule rejects Base64 values that end in = and have a length that is not a multiple of 4. Apply it first to the Authorization: Basic header.

This rule cannot see every path. Kafka SASL traffic and Base64 inside JSON bodies can go around it. Use it in addition to the update or the JVM option.

5. Look for signs of attack

Search logs and crash files for these signs:

  • Many IllegalArgumentException errors from java.util.Base64 in request handlers, in a short time or from one source.
  • Requests that contain a Base64 value that ends in = and has a length that is not a multiple of 4.
  • JVM crash files (hs_err_pid*.log) with a SIGSEGV in a garbage collector thread and a Base64$Decoder frame in compiled code.

If you find a crash with this pattern on a server that accepts internet traffic, start your incident process.

Open questions

  • The link to Base64. The CVE record says only “Compiler”. The Base64 details come from the researchers and from analysis by Endor Labs, Harness and Wiz. Oracle credits Quang Luong of Calif for this CVE.
  • The score. Oracle gives CVSS 3.1 score 8.1. Calif gives CVSS 4.0 score 9.2.
  • Code execution. Only the researchers who found the bug report it. No independent lab has published it.
  • Version numbers for OpenJDK builds. These are different for each vendor. Use the advisory from your vendor.

Sources

More from the blog.

  1. Launching Elliot-1 – a model for offensive cyber tasks

See what Elliot finds in your code.

Connect GitHub, choose a repository and Elliot runs its first full scan for free.

Run a free scan