Java4Shell (CVE-2026-114938): Dissecting OpenJDK’s AVX-512 VBMI Base64 Intrinsic Heap Out-of-Bounds Write and Pre-Auth RCE Path
Inside Java4Shell (CVE-2026-114938): how a tail opmask underflow in OpenJDK's hand-written x86-64 AVX-512 VBMI Base64 decoder intrinsic turns java.util.Base64.Decoder into a pre-authentication JVM heap out-of-bounds write primitive.
CVE-2026-114938 ("Java4Shell") (CWE-787 Out-of-Bounds Write & CWE-191 Integer Underflow in SIMD Opmask)
Severity: CRITICAL (PRE-AUTH JVM HEAP OUT-OF-BOUNDS WRITE & RCE) (CVSS 9.2 Critical (CVSS v4.0) / 8.1 High (CVSS v3.1))
Threat Actor: OpenJDK Bug JDK-8392044 / PR #32781 (Disclosed November 17, 2026); Active Probes Observed
Status: Emergency Updates Released Nov 17, 2026; Zero-Downtime JVM Flag Workarounds Available
Affected Systems: OpenJDK / Oracle Java SE / Temurin / Corretto / GraalVM 17.0.6–17.0.21, 21.0.0–21.0.13, 25.0.0–25.0.5, 27 & 8u511b33-perf on x86-64 CPUs with AVX-512 VBMI (Intel Ice Lake+ / AMD Zen 4+)
Fixed In: OpenJDK 17.0.21.1, 21.0.13.1, 25.0.5.1 (or -XX:-UseBASE64Intrinsics / -XX:UseAVX=2)
One of the bedrock security guarantees of the Java platform is memory safety: even when an application parses untrusted network bytes, the Java Virtual Machine enforces strict array bounds checks so a bug in parser logic throws an IllegalArgumentException or ArrayIndexOutOfBoundsException rather than corrupting native process memory. On November 17, 2026, that guarantee shattered at the hardware-intrinsic boundary with the disclosure of Java4Shell (CVE-2026-114938, CVSS 9.2 v4.0 / 8.1 v3.1). Residing inside OpenJDK’s HotSpot JIT compiler (StubGenerator::generate_base64_decodeBlock in stubGenerator_x86_64.cpp), the flaw is an integer underflow and opmask corruption bug in the hand-written x86-64 AVX-512 VBMI assembly stub that hardware-accelerates java.util.Base64.Decoder. When an application running on an Intel Ice Lake+ or AMD Zen 4+ processor decodes a specially crafted, malformed Base64 payload, the intrinsic miscalculates the tail write mask under L_finalBit and executes a 512-bit masked vector store (evmovdqu8) directly past the end of the destination byte[] array—corrupting adjacent Java objects on the JVM heap to trigger immediate SIGSEGV crashes, memory disclosure, or pre-authentication Remote Code Execution (RCE).

1. Am I Vulnerable? The Three Required Preconditions
Unlike Log4Shell (CVE-2021-44228), which depended on a third-party logging library, Java4Shell lives inside the Java standard library (java.base / java.util.Base64) and the HotSpot JVM runtime itself. However, because the bug exists exclusively inside a CPU-specific SIMD assembly stub, an environment is vulnerable if and only if all three of the following conditions hold simultaneously:
| Precondition | Architectural Role in the Exploit Chain | Affected vs. Not Affected |
|---|---|---|
| 1. Affected Java Runtime Version | Must include the AVX-512 VBMI Base64 decoding intrinsic introduced in JDK 17u6+ (stubGenerator_x86_64.cpp) prior to the November 17, 2026 emergency patch. |
Affected: OpenJDK / Oracle / Temurin / Corretto / GraalVM 17.0.6–17.0.21, 21.0.0–21.0.13, 25.0.0–25.0.5, 27, and Oracle 8u511b33-perf.Not Affected: Stock OpenJDK 8 and OpenJDK 11. |
2. x86-64 CPU with avx512_vbmi |
At bootstrap, HotSpot checks VM_Version::supports_avx512_vbmi(). Only if the CPU/hypervisor exposes avx512_vbmi does HotSpot emit the vulnerable VBMI assembly path. |
Affected: Intel Ice Lake+ (3rd–6th Gen Xeon Scalable: AWS m6i/c6i/r6i/m7i/c7i, GCP n2/c3, Azure Dv5/Ev5) and AMD Zen 4 / Zen 5 (EPYC Genoa/Turin: AWS m7a/c7a/r7a).Not Affected: ARM64 (Graviton, Apple Silicon), Intel Skylake/Cascade Lake, AMD Zen 1–3. |
3. Reachable java.util.Base64.Decoder |
Untrusted input reaches Base64.getDecoder(), Base64.getUrlDecoder(), or Base64.getMimeDecoder() with a payload large enough to enter the SIMD stub. |
Affected: HTTP Basic/Bearer auth headers, JWT/OIDC tokens, SAML SAMLResponse bodies (Keycloak, PingFederate), Jira/Confluence/Jenkins REST APIs, and JSON/gRPC binary fields. |
2. Execution Pipeline: How Pure Java Crosses Into Raw AVX-512 Assembly
When a Java developer calls Base64.getDecoder().decode(untrustedString), they expect execution to stay inside the pure-Java loop in java.util.Base64$Decoder.decode0(). Look at the method declaration in src/java.base/share/classes/java/util/Base64.java:
/* OpenJDK: src/java.base/share/classes/java/util/Base64.java */
@IntrinsicCandidate
private int decodeBlock(byte[] src, int sp, int sl, byte[] dst, int dp, boolean isURL, boolean isMime) {
/* Pure-Java fallback loops 4 bytes at a time with full JVM array bounds checks */
...
}Because decodeBlock() is annotated with @IntrinsicCandidate, HotSpot replaces the pure-Java method body with a direct jump into the hand-crafted native assembly stub generated at JVM startup by StubGenerator::generate_base64_decodeBlock():
┌─────────────────────────────────────────────────────────────────────────┐
│ Untrusted Network Input (HTTP / SAML / JWT / REST) │
│ Crafted Base64 Payload: 64-byte SIMD chunk + malformed '=' tail │
└────────────────────────────────────┬────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ java.util.Base64$Decoder :: decode0() │
│ 1. Estimates destination buffer size via outLength() -> allocates dst[]│
│ 2. Calls @IntrinsicCandidate decodeBlock(src, sp, sl, dst, dp, ...) │
│ 3. Bypasses pure-Java bytecode -> jumps to StubRoutines::_base64_decode│
└────────────────────────────────────┬────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ HotSpot stubGenerator_x86_64.cpp :: base64_avx512_vbmi_decode() │
│ • Active when VM_Version::supports_avx512_vbmi() == true │
│ • Loads 64 Base64 input bytes into ZMM register │
│ • Translates ASCII -> 6-bit sextets via evpermb + validation tables │
│ • Packs four 6-bit values into three 8-bit bytes via evpmultishiftqb │
│ • Compresses 64 bytes down to 48 decoded output bytes │
└────────────────────────────────────┬────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ The Bug: L_finalBit Tail Length & Opmask Underflow │
│ • When non-alphabet or '=' padding bytes appear in the block/tail, │
│ execution branches to L_finalBit / tail mask calculation │
│ • Computes output_size = (valid_input_len >> 2) * 3 │
│ • Malformed tail / padding causes integer underflow / bad shift count │
│ when populating the 64-bit AVX-512 opmask register (k1) │
└────────────────────────────────────┬────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────────────┐
│ evmovdqu8 [dst + dp]{k1}, zmm0 (Heap OOB Write!) │
│ • Masked 512-bit store writes up to 48–64 bytes PAST the end of dst[] │
│ • Overwrites adjacent object header, _klass pointer, or array length │
│ inside the Thread-Local Allocation Buffer (TLAB) -> DoS / RCE │
└─────────────────────────────────────────────────────────────────────────┘3. Root Cause in stubGenerator_x86_64.cpp: The AVX-512 VBMI Opmask Underflow
In standard Base64 encoding, every 4 ASCII characters (4 * 6 = 24 bits) decode into 3 raw bytes (3 * 8 = 24 bits). With AVX-512 VBMI, a single 512-bit ZMM register holds 64 ASCII Base64 characters, which decode in parallel into 48 output bytes:
evpermb(Full-Register Byte Permutation): Uses two 64-byte lookup tables inZMMregisters to map each ASCII character to its 6-bit numeric value (0..63) while flagging any non-alphabet character (including'='padding) by setting bit 7 (0x80).evpmovb2m k_err, zmm_translated: Extracts the high sign bit of every byte in the 64-byte vector into a 64-bit opmask register (k_err). Whenk_err != 0(meaning the 64-byte vector load encountered'='padding, whitespace, or a non-Base64 character), the fast loop exits to theL_finalBittail handler to compute how many valid 4-byte Base64 quantum groups preceded the non-alphabet byte and write only those decoded bytes using a dynamic opmask (k1).
/* Conceptual reconstruction of the vulnerable AVX-512 VBMI tail path
* in OpenJDK src/hotspot/cpu/x86/stubGenerator_x86_64.cpp (JDK-8392044) */
// 1. After loading a chunk and detecting non-alphabet / '=' padding via k_err:
__ kmovq(rax, k_err);
// ... computes valid input character count in current block ...
// 2. Convert valid input Base64 chars into output byte count:
// output_size = (valid_chars / 4) * 3
__ sarl(len_reg, 2); // len_reg = valid_chars >> 2
__ lea(out_len, Address(len_reg, len_reg, Address::times_2)); // out_len = len_reg * 3
// 3. Construct the AVX-512 byte-write opmask k1 for the final store:
// BUG: When a crafted input triggers the tail path with a sub-quantum
// or padded tail boundary (e.g., 64 valid bytes followed by '=' where
// dst[] was sized by outLength() for the padded stream, or where the
// remaining length calculation underflows / misaligns with dst[] capacity):
__ mov64(tmp_mask, -1L); // 0xFFFFFFFFFFFFFFFF
__ shrxq(tmp_mask, tmp_mask, shift_cnt);
__ kmovq(k1, tmp_mask);
// 4. Masked 512-bit vector write into the Java heap byte[] array:
// Writes every byte lane where k1 bit == 1 directly to [dst + dp]!
__ evmovdqu8(Address(dst, dp, Address::times_1), k1, zmm_decoded, Assembler::AVX_512bit);evmovdqu8 Writes Past dst.length
Before decodeBlock() runs, Base64.Decoder.outLength() scans the tail of the input buffer to allocate an exact-fit byte[] dst array on the Java heap. When a crafted payload (such as a 64-byte block combined with specific tail/padding bytes like 64 * 'A' + '=') enters the VBMI intrinsic, the mismatch and underflow in L_finalBit's tail mask calculation leaves high bits enabled in opmask register k1—causing evmovdqu8 [dst + dp]{k1}, zmm0 to write up to 48–64 controlled bytes directly past the end of dst[]!4. Exploit Paths: From TLAB Heap Overflow to Infoleak, DoS & RCE
In modern OpenJDK (running G1GC or ZGC), worker threads allocate objects sequentially via bump-pointer arithmetic inside a Thread-Local Allocation Buffer (TLAB). That means the newly allocated byte[] dst array sits immediately adjacent in virtual memory to the next object allocated by that thread:
HotSpot Thread-Local Allocation Buffer (TLAB) — Contiguous Bump-Pointer Memory
┌───────────────────────────────────────────────┬───────────────────────────────────────────────┐
│ Victim Allocation: byte[] dst │ Adjacent Object in TLAB (Allocated Next/Prior)│
├──────────────┬──────────────┬──────────┬──────┼──────────────┬──────────────┬──────────┬──────┤
│ markWord │ _klass ptr │ length │ body │ markWord │ _klass ptr │ length │ refs │
│ (8 bytes) │ (4 bytes) │ (4 bytes)│ N B │ (8 bytes) │ (4 bytes) │ (4 bytes)│ ... │
└──────────────┴──────────────┴──────────┴───┬──┴──────────────┴──────────────┴──────────┴──────┘
│
└──► 💥 evmovdqu8 [dst + dp]{k1}, zmm0
Overwrites 16–48 bytes across boundary!- Path 1 — Adjacent Array
lengthCorruption (Heartbleed-Style Infoleak & Relative Heap R/W): In 64-bit HotSpot with Compressed OOPs (-XX:+UseCompressedClassPointers), an array header is 16 bytes: an 8-bytemarkWord, a 4-byte compressed_klasspointer, and a 4-bytelengthinteger at offset+12. By shaping TLAB allocations and overwriting an adjacentbyte[]orchar[]'slengthfield with a large integer while preserving its_klasspointer, the attacker disables Java bounds checking on that array—reading or writing arbitrary adjacent JVM heap memory (session tokens, TLS keys, OAuth secrets). - Path 2 —
_klassPointer /DirectByteBufferCorruption to Native RCE: Overwriting the raw 64-bitaddressandcapacityfields of an adjacentjava.nio.DirectByteBuffer(or redirecting an object's_klasspointer to a fakeInstanceKlassvtable in a controlled heap buffer) upgrades the TLAB overflow into an arbitrary 64-bit native memory read/write primitive, hijacking JIT code-cache stubs or function pointers for full OS-level Remote Code Execution. - Path 3 — Pre-Auth JVM Crash (Single-Packet DoS): Any unaligned overwrite of an adjacent object's
_klasspointer causes the very next virtual method call or G1GC young-generation evacuation pause to dereference an invalid Metaspace address, terminating the entire Java process withSIGSEGV (0xb).
5. Exploit Telemetry & Production Detection Rules (ModSecurity, Suricata, Sigma & SIEM)
1. In-the-Wild Exploit Telemetry & Payload Geometry
Following public disclosure on November 17, 2026, threat intelligence sensors (including GreyNoise and VulnCheck) observed rapid weaponization of CVE-2026-114938 targeting internet-exposed Java identity providers and enterprise web applications. To build high-signal detection without false positives from normal Base64 traffic, defenders should anchor on the three physical constraints of a Java4Shell exploit payload:
- The 64-Byte SIMD Entry Threshold (
len >= 65bytes): InStubGenerator::generate_base64_decodeBlock(), the AVX-512 VBMI vector loop processes 64 Base64 input bytes per iteration (one full 512-bitZMMload). Inputs shorter than 64 bytes skip the 512-bit VBMI loop entirely. Every functional Java4Shell trigger therefore contains at least one 64-byte block of valid Base64 characters immediately followed by a malformed tail (=,==, or non-alphabet byte) at offset64 * N + r(such as the minimal 65-byte crash PoC"A" * 64 + "="). - Violation of RFC 4648 4-Byte Quantum Alignment: Legitimate Base64 strings have a total length divisible by 4 (
len % 4 == 0), with=or==appearing strictly at the end of a 4-byte quantum. Java4Shell exploit probes supply non-quantum-aligned padding (e.g., 65-byte, 66-byte, or64*N + 1-byte strings ending in=, or interior=padding followed by TLAB heap-spray bytes) to forceBase64.Decoder.outLength()to allocate a smallerbyte[] dstbuffer than theL_finalBitVBMI opmask (k1) actually writes. - Host-Level Crash Telemetry (
hs_err_pid*.log& Delayed TLAB GC Crashes): Failed or misaligned exploit probes corrupt the 4-byte compressed_klasspointer at offset+8of the object immediately followingdst[]in the TLAB, producing either an immediateSIGSEGV (0xb)inv ~StubRoutines::base64_decodeBlockor a delayedSIGSEGVmilliseconds later insideG1ParScanThreadState::copy_to_survivor_spaceduring young-generation garbage collection.
# Typical HotSpot hs_err_pid<pid>.log signature from a Java4Shell exploit probe:
# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x00007f8b9c04e3a4, pid=1482, tid=1519
# JRE version: OpenJDK Runtime Environment Temurin-21.0.13+7 (21.0.13+7)
# Problematic frame:
# v ~StubRoutines::base64_decodeBlock 0x00007f8b9c04e3a42. ModSecurity / Coraza WAF Rules (IDs 950030–950032)
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2026 James Luther <[email protected]>
# ColibriSec Detection Rules for Java4Shell (CVE-2026-114938)
# --- 950030: Malformed 64-byte SIMD Base64 tail in Authorization header ------
SecRule REQUEST_HEADERS:Authorization \
"@rx (?:basic|bearer)[[:space:]]+(?:[A-Za-z0-9+/_-]{64})+={1,2}[A-Za-z0-9+/_=-]*" \
"id:950030,phase:1,deny,status:403,log,auditlog,t:none,\
msg:'Java4Shell (CVE-2026-114938): Malformed 64B-boundary Base64 tail in Authorization header',\
tag:'attack-rce',tag:'cve-2026-114938',tag:'java4shell'"
# --- 950031: Malformed Base64 tail in SAML / OIDC / OAuth parameters ---------
SecRule ARGS:SAMLResponse|ARGS:SAMLRequest|ARGS:RelayState|ARGS:code|ARGS:state|REQUEST_COOKIES \
"@rx ^(?:[A-Za-z0-9+/_-]{64})+(?:=|==[A-Za-z0-9+/_-]|[A-Za-z0-9+/_-]{1,3}=)" \
"id:950031,phase:2,deny,status:403,log,auditlog,t:none,t:urlDecodeUni,\
msg:'Java4Shell (CVE-2026-114938): Non-quantum 64B Base64 padding in SSO/cookie parameter',\
tag:'attack-rce',tag:'cve-2026-114938',tag:'java4shell'"
# --- 950032: Interior '=' padding inside >=64B Base64 block in request body ---
SecRule REQUEST_BODY \
"@rx [A-Za-z0-9+/_-]{64,}={1,2}[A-Za-z0-9+/_-]{4,}" \
"id:950032,phase:2,deny,status:403,log,auditlog,t:none,t:urlDecodeUni,\
msg:'Java4Shell (CVE-2026-114938): Interior Base64 padding with trailing heap-spray bytes',\
tag:'attack-rce',tag:'cve-2026-114938',tag:'java4shell'"3. Suricata IDS / Network Telemetry Signatures
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"COLIBRISEC EXPLOIT Java4Shell CVE-2026-114938 Malformed 64B Base64 Tail in Authorization Header"; flow:established,to_server; http.header; content:"Authorization|3a|"; nocase; pcre:"/Authorization\x3a\s+(?:Basic|Bearer)\s+(?:[A-Za-z0-9+\/_-]{64})+(?:=[A-Za-z0-9+\/_=-]*|[A-Za-z0-9+\/_-]{1,2}=)(?:\r|\n|$)/Hi"; reference:cve,2026-114938; classtype:attempted-admin; sid:2026114938; rev:1;)
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"COLIBRISEC EXPLOIT Java4Shell CVE-2026-114938 Malformed Base64 Padding in SAMLResponse"; flow:established,to_server; http.request_body; content:"SAMLResponse="; pcre:"/SAMLResponse=(?:[A-Za-z0-9+\/_-]|%2[bBfF]|%5[fF]){64,}(?:=|%3[dD]){1,2}(?:[A-Za-z0-9+\/_-]|%2[bBfF]){1,}/Pi"; reference:cve,2026-114938; classtype:attempted-admin; sid:2026114939; rev:1;)4. Sigma Rules for Host & Process Telemetry
title: HotSpot JVM Crash in Base64 Intrinsic or TLAB GC Walk (CVE-2026-114938 / Java4Shell)
id: 7a19e4b2-9c81-54e0-a2f4-8192044c2611
status: experimental
description: >
Detects HotSpot JVM fatal crash logs (hs_err_pid) or syslog/journald crash events
referencing StubRoutines::base64_decodeBlock caused by Java4Shell (CVE-2026-114938).
author: James Luther (ColibriSec)
date: 2026/11/19
logsource:
product: linux
service: syslog
detection:
selection_frame:
- 'StubRoutines::base64_decodeBlock'
- 'generate_base64_decodeBlock'
selection_jvm_crash:
- 'A fatal error has been detected by the Java Runtime Environment'
- 'SIGSEGV (0xb)'
condition: selection_frame and selection_jvm_crash
level: critical
tags:
- attack.t1190
- cve.2026.114938
---
title: Suspicious Shell or Network Utility Spawned by Java Process (Java4Shell Post-Exploitation)
id: 9b32c810-4e11-5a72-910c-384910248219
status: experimental
author: James Luther (ColibriSec)
date: 2026/11/19
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|endswith:
- '/java'
selection_child:
Image|endswith:
- '/sh'
- '/bash'
- '/dash'
- '/curl'
- '/wget'
- '/nc'
- '/python3'
- '/socat'
condition: selection_parent and selection_child
level: critical
tags:
- attack.t1059.004
- cve.2026.1149385. Splunk SIEM Hunting Queries
# 1. Hunt web/gateway logs for HTTP 500/502/503 spikes on SSO/API routes correlated with JVM crashes:
index=web (uri="*/protocol/saml*" OR uri="*/oauth/*" OR uri="*/login*" OR uri="*/api/*") status IN (500, 502, 503, 504)
| stats count values(uri) as uris by clientip, host, bin(_time, 1m)
| where count >= 3
# 2. Hunt Linux host logs / Kubernetes stdout for HotSpot base64_decodeBlock SIGSEGV:
index=os OR index=kubernetes ("StubRoutines::base64_decodeBlock" OR ("hs_err_pid" AND "SIGSEGV"))
| table _time host pod_name container_name _raw6. Remediation, Fleet Auditing & Zero-Downtime Mitigation
hs_err_pid*.log Crash Dumps: Misaligned Java4Shell probes corrupt adjacent _klass pointers and crash the JVM with SIGSEGV inside StubRoutines::base64_decodeBlock or during GC object scanning.
Verify Host CPU Flags & JVM Intrinsics: Check /proc/cpuinfo for avx512_vbmi and inspect active HotSpot flags via -XX:+PrintFlagsFinal.
Apply Zero-Downtime JVM Flag Workaround Immediately: Pass -XX:+UnlockDiagnosticVMOptions -XX:-UseBASE64Intrinsics (or -XX:UseAVX=2) to disable the vulnerable assembly stub while you roll out patched JDK builds (17.0.21.1, 21.0.13.1, 25.0.5.1).
# 1. Audit whether the host CPU and JVM are actively running the vulnerable VBMI stub:
grep -q "avx512_vbmi" /proc/cpuinfo && echo "[!] CPU exposes avx512_vbmi" || echo "[+] Safe CPU"
java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version 2>&1 | grep -E "UseBASE64Intrinsics|UseAVX"
# 2. Immediate JVM Flag Workaround (Disables ONLY the Base64 hardware intrinsic):
export JAVA_TOOL_OPTIONS="-XX:+UnlockDiagnosticVMOptions -XX:-UseBASE64Intrinsics"
# Alternative: Cap HotSpot vector instruction generation at AVX2:
# export JAVA_TOOL_OPTIONS="-XX:UseAVX=2"
# 3. Upgrade OpenJDK / Temurin / Corretto packages to Nov 17, 2026 emergency releases:
# Java 17 -> 17.0.21.1+ | Java 21 -> 21.0.13.1+ | Java 25 -> 25.0.5.1+
# 4. Hunt for Java4Shell exploitation crashes in HotSpot error logs:
find / -name "hs_err_pid*.log" 2>/dev/null | xargs grep -En "base64_decodeBlock|StubRoutines::|SIGSEGV" 2>/dev/null