Java4Shell HotSpot Flaw Can Enable Heap Disclosure and Remote Code Execution

Summary
Java4Shell (CVE-2026-114938) is a HotSpot Base64 decoder heap overflow on x86-64 CPUs with AVX-512 VBMI. The article explains how malformed padding triggers the overwrite, potential heap disclosure or RCE, affected JDKs, and mitigations.
Key points
- Malformed Base64 padding can make HotSpot's C2 decoder calculate a negative output length, producing an all-ones mask and a 64-byte store that writes 62 bytes beyond the output buffer.
- The overwrite can crash the JVM or expose heap data such as private keys and tokens; unauthenticated RCE may be possible with an application-specific exploit.
- The vulnerable code path requires an x86-64 CPU with AVX-512 VBMI and a decoder compiled by C2; ARM64 is not affected.
- The article identifies OpenJDK 17.0.6 and newer and downstream distributions as affected, subject to the CPU requirement, and lists affected Oracle Java versions.
- The described exploit chain manipulates neighboring heap objects to expand read and write capabilities; heap layout, network timing, and application behavior constrain exploitation.
- The article recommends applying vendor JDK patches. Temporary mitigations are disabling Base64 intrinsics with -XX:-UseBASE64Intrinsics or limiting JVM AVX use with -XX:UseAVX=2.
- It also recommends inventorying bundled Java runtimes and investigating repeated JVM crashes, bursts of Base64 decoding errors, and unusually large responses.
Article Details
- Attack Vectors
- An attacker can send malformed padded Base64 to an application that decodes attacker-supplied input using an affected JDK on an x86-64 CPU with AVX-512 VBMI; the decoder's C2-compiled intrinsic can write beyond its output buffer.
- The article describes application-specific HTTP exploit chains that can use the memory corruption to crash the JVM, disclose heap contents, or potentially achieve unauthenticated remote code execution. Each target requires its own exploit.
- Defensive Notes
- Patch affected JDKs using the distribution vendor's patched build, prioritizing internet-facing systems; check runtimes bundled in applications, containers, and appliances as well as host-installed JDKs.
- Until patched, disable the vulnerable path with -XX:-UseBASE64Intrinsics or, on x86-64, -XX:UseAVX=2; verify the setting takes effect before relying on it.
- Check for the required CPU flags avx512f, avx512bw, avx512vbmi, and bmi2 when prioritizing exposure; the article states ARM64 is not affected.
- Investigate unexpected JVM crashes or restarts, bursts of Base64 decoding errors on an endpoint, and unusually large responses from endpoints that echo decoded data.
MITRE ATT&CK
T1190 · Exploit Public-Facing ApplicationThe article describes sending malformed Base64 through an application endpoint to exploit the vulnerable JDK decoder and potentially gain unauthenticated remote code execution.T1499.004 · Application or System ExploitationThe malformed input can trigger the out-of-bounds write and crash the JVM; the article notes failed exploitation attempts may cause crashes and an attacker can retry.
CVE
Vendors
Products
HotSpot JVMJava4Shell (CVE-2026-114938) is a heap out-of-bounds write in the HotSpot JVM's x86-64 Base64 decoder intrinsic.OpenJDKOpenJDK 17.0.6 and newer and its downstream distributions are affected only on x86-64 CPUs with AVX-512 VBMI.Oracle Java SEVulnerable Oracle Java SE versions are 8u511b33-perf, 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3 and 27.0.1.0.3 [3]. The 8u entry falls outside the 17.0.6-and-newer OpenJDK range, so check the Oracle advisory for the exact
