
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.
| CVE | CVE-2026-114938 |
| Component | HotSpot JIT compiler — x86-64 Base64 decode intrinsic |
| Severity | CVSS 3.1 8.1 (Oracle / OpenJDK: AV:N/AC:H/PR:N/UI:N); CVSS 4.0 9.2 (Calif.io) |
| Authentication | None required — Oracle lists it as remotely exploitable without authentication |
| Affected | OpenJDK 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 |
| Hardware | x86-64 CPUs with AVX-512 VBMI. ARM64 is not affected |
| Fixed | 17 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.
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:
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?
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
-
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.
-
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.
-
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.
-
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.
-
Watch for the warning signs. Look for unexplained JVM crashes, bursts of
IllegalArgumentExceptionfrom 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.