Java4Shell: 65-Byte Base64 Payload Triggers RCE in OpenJDK AVX-512 Intrinsic
A critical vulnerability (CVE-2026-114938) in OpenJDK's AVX-512 VBMI-optimized Base64 decoder allows remote code execution via a 65-byte malformed input. Affected versions include Java 17.0.6+, 21, 25, 27 on x86-64 CPUs with AVX-512 VBMI; mitigations include disabling the intrinsic or AVX-512 path.
Vulnerability Overview
On November 17, 2026, security research firm Calif disclosed a high-severity vulnerability in OpenJDK tracked as CVE-2026-114938 and codenamed Java4Shell. The flaw resides in the JDK's built-in Base64 decoding optimization path for x86-64 processors supporting AVX-512 VBMI (Vector Byte Manipulation Instructions). A specially crafted 65-byte malformed Base64 string — 64 'A' characters followed by a single '=' — triggers an integer underflow in the hand-written assembly intrinsic, causing a full-width write mask and an out-of-bounds heap write of approximately 62 bytes.
Technical Root Cause
OpenJDK replaces the standard Java Base64 decoder with a HotSpot C2 compiler intrinsic (hand-written assembly) on CPUs that support AVX-512 VBMI (Intel Ice Lake and later Xeon, AMD Zen 4 and later EPYC/Ryzen). The vulnerability occurs in the tail-block handling code when the padding character '=' appears in an unexpected position or count. The output length calculation underflows to a value like -1, which is then used to construct a vector write mask of all ones. The subsequent VMOVDQU8 instruction writes 64 bytes (one full ZMM register) past the end of the destination buffer, corrupting adjacent heap objects.
Critically, the memory corruption happens in the native intrinsic before the Java-layer validation that would normally reject the malformed input and throw IllegalArgumentException. By the time the exception is raised, the heap has already been damaged.
Affected Versions and Platforms
OpenJDK / Java 17: 17.0.6 through 17.0.21.0 (fixed in 17.0.21.1+)
Java 21: versions before 21.0.13.1 (fixed in 21.0.13.1+)
Java 25: versions before 25.0.5.1 (fixed in 25.0.5.1+)
Java 27: versions before 27.0.1.1 (fixed in 27.0.1.1+)
Oracle Java SE: 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3, 27.0.1.0.3, and the Oracle Java 8 Enterprise Performance Pack 8u511b33-perf GraalVM: Oracle GraalVM for JDK 17/21, GraalVM EE 21.3.20.0.3 and similar
Standard Java 8 and 11 are not affected because they lack the AVX-512 decoding path. ARM64 platforms are also unaffected. Virtualized environments that do not expose AVX-512 VBMI to the guest will not enter the vulnerable code path.
Exploitation Reality
Calif demonstrated pre-authentication RCE against default configurations of Keycloak, Jira, Confluence, Jenkins, JFrog Artifactory, and PingFederate. Kafka, Solr, and Elasticsearch require authentication before the vulnerable decoder is reached. Datadog Security Labs' independent analysis emphasizes that the most common and readily achievable impact is denial-of-service and JVM crashes (observed via adjacent array header corruption leading to GC crashes), and that there is no universal "one payload exploits all" weapon; each target application and JVM environment requires bespoke exploit engineering.
Mitigation and Workarounds
Two JVM startup flags can disable the vulnerable path:
Preferred (cross-architecture): -XX:-UseBASE64Intrinsics — falls back to the pure Java decoder. Works on both x86-64 and ARM64; incurs a performance penalty on Base64-heavy workloads.
x86-64 only: -XX:UseAVX=2 — disables AVX-512 optimizations globally, indirectly avoiding the bug. Datadog testing confirms it stops the observed out-of-bounds write. However, it also degrades other AVX-512-accelerated operations and is unrecognized by ARM64 JVMs, so it must be rolled out per-architecture to avoid startup failures on mixed clusters.
Both flags require a JVM restart. Verify active flags with jcmd <PID> VM.flags -all.
Fix and Verification
The upstream fix (JDK-8393212) adds a three-line guard length < 4 before the vectorized tail processing. Oracle released patched builds in its November 2026 Critical Patch Update. CISA and other agencies urge immediate inventory and patching. Because downstream distributions (Adoptium, Azul, Red Hat, etc.) may use different version suffixes and release schedules, operators should verify the exact installed package version, container image digest, or distribution security advisory rather than relying solely on the major version number.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
