Java4Shell, CVE-2026-114938: a hex dump of the target array after decoding 64 A characters plus one equals sign, showing decoded zero bytes at offsets 0 to 49, a highlighted overwritten region from 50 to 111, and untouched 0x5a bytes after it

Vulnerability Analysis • NOV 18, 2026

Java4Shell (CVE-2026-114938): How a Base64 Bug in OpenJDK Leads to Remote Code Execution

TL;DR: Java4Shell (CVE-2026-114938) is a memory-corruption bug in the hand-optimised Base64 decoder that OpenJDK uses on modern x86-64 servers. A single malformed string — 64 letters followed by one = — makes the decoder write 62 bytes past the end of its output buffer. Calif.io’s researchers turned that spill into a heap leak and then remote code execution against widely used Java applications in their default configurations. Oracle and OpenJDK shipped fixes on 17 November 2026. Patch your JDKs now; if you cannot, disable the Base64 intrinsic.

Overview

The vulnerability was discovered by Quang Luong of Calif.io, whose write-up, Java4Shell: Write once, RCE everywhere, is the primary technical source for this article. Oracle’s November 2026 Critical Security Patch Update also credits Albert Yang for reporting the same CVE.

CVECVE-2026-114938
ComponentHotSpot JIT compiler — x86-64 Base64 decode intrinsic
SeverityCVSS 3.1 8.1 (Oracle / OpenJDK: AV:N/AC:H/PR:N/UI:N); CVSS 4.0 9.2 (Calif.io)
AuthenticationNone required — Oracle lists it as remotely exploitable without authentication
AffectedOpenJDK 17, 21, 25 and 27 up to 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3 and 27.0.1.0.3; Oracle Java SE (including 8u511b33-perf); Oracle GraalVM for JDK 17 and 21
Hardwarex86-64 CPUs with AVX-512 VBMI. ARM64 is not affected
Fixed17 November 2026 releases from Oracle and OpenJDK

Because the bug lives in OpenJDK itself, it reaches every distribution built on it. Calif lists Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine and Red Hat’s builds alongside Oracle’s.

Why Base64 Is Such a Dangerous Place for a Bug

Base64 is how software carries binary data inside text: authentication headers and tokens, file uploads, certificates, API payloads and message queues. In most Java applications, attacker-supplied Base64 reaches a decoder long before any login check. Calif reports demonstrating remote code execution, in default configurations, against:

  • Before authentication: Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate.
  • After authentication: Apache Kafka brokers, Solr, Elasticsearch, Gerrit and Spinnaker.

They also showed it in sample applications built on Apache Struts and Spring Boot, and describe the list as non-exhaustive. The product-specific exploit chains are being withheld until organisations have had time to patch.

Technical Deep Dive: The 62-Byte Spill

To decode Base64 quickly, HotSpot replaces the Java implementation with a hand-written assembly routine — an intrinsic — once the code is hot enough for the C2 JIT compiler to optimise. On CPUs with AVX-512 VBMI, this routine processes 64 bytes at a time and uses a bit mask to decide which bytes of each 64-byte store actually reach memory.

The last few input bytes are handled by a short tail routine that computes that mask. Calif’s write-up gives the logic in pseudocode:

input_mask := bzhiq(-1, input_length)
output_len := (input_length / 4) * 3

// handle padding
if input[input_length - 1] == '=':
    output_len -= 1
    input_mask >>= 1
    if input[input_length - 2] == '=':
        output_len -= 1
        input_mask >>= 1

output_mask := bzhiq(-1, output_len)

When the remaining tail is something like a lone =, output_len starts at zero and the padding check subtracts one anyway. The value underflows to -1, which the bzhiq instruction treats as a huge length — so it clears nothing, and the mask becomes all 64 bits set. The masked store that should write almost nothing writes a full 64 bytes.

How a 65-byte Base64 input overflows a 50-byte buffer An input of 64 A characters and one equals sign leaves a tail whose output length is zero. The padding check decrements it to minus one, the mask becomes all 64 bits, and a single 64-byte store at offset 48 overwrites bytes 50 to 111, which belong to the neighbouring heap object. FIG. 1 · THE 62-BYTE SPILL INPUT · 65 BYTES A A A A A A A A … × 64 = MASK CALCULATION ON THE TAIL tail = "=" output_len = 0 '=' → len -= 1 = -1 (underflow) bzhiq(-1, -1) mask = all 64 HEAP AFTER ONE MASKED 64-BYTE STORE result[ ] · 50 bytes next heap object · 62 bytes overwritten 0 50 111 one 64-byte store from offset 48 Java then throws IllegalArgumentException, but the neighbour is already corrupted.
Figure 1. Bytes 48 and 49 are legitimate output. Bytes 50 to 111 land in whatever object sits next on the heap.

For a 65-byte input the expected output is 50 bytes. The store starts at offset 48 and writes 64, so 62 bytes (offsets 50–111) land in the neighbouring heap object. The routine then notices the input is invalid and Java throws an IllegalArgumentException — but the damage is already done, so error handling does not protect you.

You can see the bug safely with a condensed version of Calif’s proof of concept. Every write stays inside a real 4,096-byte array:

Base64.Decoder dec = Base64.getDecoder();
byte[] valid  = "A".repeat(64).getBytes(US_ASCII);
byte[] bad    = ("A".repeat(64) + "=").getBytes(US_ASCII);
byte[] target = new byte[4096];

for (int i = 0; i < 200_000; i++) dec.decode(valid, target); // warm up C2

Arrays.fill(target, (byte) 0x5a);
try { dec.decode(bad, target); } catch (IllegalArgumentException e) { }
// Affected JDK: bytes 50..111 of target are no longer 0x5a

The Attack Path: From Spill to Shell

Sixty-two bytes of only partly controlled data is not code execution on its own. Calif’s write-up describes how they built it up into a full chain:

Java4Shell exploitation chain in six stages Warm up the decoder, trigger the spill, use it to build a write primitive, use that to build a reader that leaks heap memory, repair the damaged objects, then escalate to an arbitrary write that reaches code execution. FIG. 2 · FROM SPILL TO SHELL 01 WARM UP Send valid Base64 until HotSpot's C2 compiler swaps in the AVX-512 decoder. Nothing is corrupted yet. 02 TRIGGER Send 64 × "A" + "=". The padding underflow spills 62 bytes into the next object on the heap. 03 BUILD A WRITER The spill enlarges a neighbouring array's length, giving a bounded out-of-bounds write. 04 BUILD A READER · "JAVABLEED" The writer resizes an array the app echoes back, leaking heap memory: keys, tokens, personal data. 05 REPAIR Leaked originals are written back over damaged headers so the JVM keeps running without crashing. 06 ESCALATE · CODE EXECUTION The bounded write grows into an arbitrary write aimed at the Code Cache and JVM hooks.
Figure 2. The stages Calif.io describes. Stage 4 alone is a serious breach, before any code runs.

Two details matter for defenders. First, stage 4 is already a breach: an attacker who can read the Java heap can steal session tokens, private keys and customer data without ever running code. Second, there is no universal exploit. Each application needs its own heap-grooming profile, and Calif notes that a failed attempt can crash the JVM, which can then simply be retried. Unexplained JVM crashes on internet-facing Java services deserve a closer look.

The research also carries a broader warning. Calif reports that Quang Luong found the bug in about an hour with an AI coding agent, built a first working exploit in two more, and spent less than $200 on tokens. Bugs like this are getting much cheaper to find and weaponise, so the time between disclosure and real-world exploitation will keep shrinking.

Are You Exposed?

Java4Shell exposure check A system is exposed if it runs an affected JDK 17, 21, 25 or 27 build, on an x86-64 CPU with AVX-512 VBMI, and decodes attacker-supplied Base64. Answering no to any of these means the bug is not reachable. FIG. 3 · ARE YOU EXPOSED? Unpatched JDK 17, 21, 25 or 27? Any OpenJDK build · Oracle 8u -perf · GraalVM No → not affected YES x86-64 CPU with AVX-512 VBMI? Intel Ice Lake and newer Xeons · AMD Zen 4+ No → not affected (incl. all ARM64) YES Decodes attacker-supplied Base64? Auth tokens · uploads · APIs — assume yes No → not reachable YES EXPOSED · PATCH NOW Upgrade to the 17 Nov 2026 JDK release. Until then: -XX:-UseBASE64Intrinsics
Figure 3. All three conditions must hold. In practice, the third almost always does.

Check the hardware condition on a Linux host with the command Calif provides. If all four flags print, the CPU can run the vulnerable code path:

grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' \
  | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'

Then confirm which runtime each service actually uses and whether the intrinsic is enabled:

java -XshowSettings:properties -version 2>&1 | grep java.runtime.version
java -XX:+PrintFlagsFinal -version | grep -E 'UseBASE64Intrinsics|UseAVX '

Remember that containers ship their own JDK. Patching the host does nothing for a Docker image that bundles an older Temurin or Corretto, so rebuild those images too.

How to Respond

  1. Patch first. Move every Java runtime to the release issued on 17 November 2026 for its line, following the OpenJDK advisory or your vendor’s notice. Start with internet-facing identity, CI/CD, collaboration and artifact services.

  2. Apply a workaround where you cannot patch today. Calif lists two JVM options. Disabling only the Base64 intrinsic is the narrower choice:

    # Disable the vulnerable hardware-accelerated decoder
    export JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics"
    
    # Or disable AVX-512 entirely (x86-64 only; the JVM fails to start on ARM)
    export JAVA_TOOL_OPTIONS="-XX:UseAVX=2"

    Expect slower Base64 handling, and remove the flag once you have patched.

  3. Do not rely on the edge. Calif notes that reverse-proxy request buffering is not a general mitigation: it does not stop their Elasticsearch chain, and it no longer applies after a WebSocket upgrade.

  4. Inventory the long tail. Bundled runtimes inside vendor appliances, build agents and third-party products are easy to miss. Ask suppliers for their patch timelines.

  5. Watch for the warning signs. Look for unexplained JVM crashes, bursts of IllegalArgumentException from Base64 decoding, and repeated requests carrying long runs of identical Base64 characters, especially from a single source.

The Core Defences Perspective

Java4Shell is a reminder that “we don’t use that library” is not a safe answer when the bug sits in the runtime itself. In our application and API testing work, Base64 shows up on almost every pre-authentication path: login tokens, SSO assertions, upload handlers and webhook signatures. A configuration review and hardening exercise checks the other half of the problem, finding every JDK actually running across hosts, containers and appliances. Once public exploit chains appear, threat hunting for JVM crash patterns on exposed services is a practical way to find attempts that slipped through before patching.

Credit

This analysis is based on the original research by Quang Luong of Calif.io: Java4Shell: Write once, RCE everywhere.