Vulnerability
Java4Shell (CVE-2026-114938): How an AVX-512 Base64 Bug Exposes OpenJDK 17–27
Java4Shell (CVE-2026-114938) is a newly disclosed memory corruption flaw in OpenJDK's AVX-512 VBMI Base64 decoder affecting Java 17.0.6 through 27 on modern Intel and AMD x86-64 CPUs. Because applications routinely decode Base64 HTTP Basic credentials, SAML tokens, and CSRF values before login, exposed services can face crashes or pre-authentication code execution. Learn how to check your host CPU flags, verify running JVM options, and deploy safe interim mitigations alongside patched OpenJDK builds.
8 min read
Java4Shell (CVE-2026-114938): How an AVX-512 Base64 Bug Exposes OpenJDK 17–27
Executive Summary
On November 17, 2026, Oracle and OpenJDK disclosed CVE-2026-114938—widely tracked as Java4Shell—a heap memory corruption vulnerability in OpenJDK's hardware-accelerated Base64 decoder (java.util.Base64.Decoder). When an affected Java Virtual Machine (JVM) running OpenJDK 17.0.6 or later (including Java 17, 21, 25, and 27) executes on an x86-64 processor supporting the AVX-512 Vector Byte Manipulation Instructions (VBMI) extension, specially crafted Base64 input triggers an integer underflow and an out-of-bounds heap write.
Because Java web frameworks, identity providers, and enterprise middleware routinely decode Base64-encoded HTTP Basic credentials, SAML assertions, and CSRF tokens before authentication completes, exposed applications can suffer immediate JVM crashes (denial of service) or, under tailored heap conditions, pre-authentication remote code execution (RCE). Crucially, OpenJDK 8, OpenJDK 11, ARM64 systems, and x86-64 CPUs lacking AVX-512 VBMI are not affected.
While vendor-patched builds (17.0.21.1+4, 21.0.13.1+4, 25.0.5.1+4, 27.0.1.1+4) are rolling out, organizations can immediately eliminate the vulnerable code path without upgrading the runtime by starting affected x86-64 JVMs with -XX:-UseBASE64Intrinsics.
Confidence Level: High for affected Java release lines, AVX-512 VBMI hardware prerequisites, root-cause integer underflow mechanics, and -XX:-UseBASE64Intrinsics mitigation efficacy (corroborated across Red Hat RHSB-2026-018, Datadog Security Labs, Keycloak, and Elastic). Moderate for universal RCE reliability, as Datadog and Cloudflare note that reliable code execution requires application-specific heap shaping, whereas Denial of Service is readily achievable.
Technical Mechanics and Architecture
From Java Standard Library to Native HotSpot Intrinsics
When a Java application calls Base64.getDecoder().decode() or Base64.getUrlDecoder().decode(), the standard library first computes the required destination byte array size using decodedOutLength() and allocates dst. (By contrast, Base64.getMimeDecoder() bypasses the vulnerable path in tested OpenJDK 17.0.6 builds.)
Further down the call stack, HotSpot's C2 optimizing compiler replaces the pure-Java decodeBlock() loop with a native CPU-specific intrinsic (generate_base64_decodeBlock). On x86-64 processors that advertise the avx512vbmi CPU flag—such as Intel Ice Lake, Sapphire Rapids, Emerald Rapids, and Granite Rapids, or AMD Zen 4, Zen 5, and Zen 6—the JVM automatically selects the AVX-512 VBMI accelerated routine.
[Untrusted Client Input: 128 × 'A' + '=']
│
▼ (HTTP Basic Auth / SAML / Token before login)
┌──────────────────────────────────────────────────────────┐
│ java.util.Base64.Decoder.decode() │
│ 1. decodedOutLength() allocates 98-byte dst[] array │
│ 2. C2 Compiler dispatches to AVX-512 VBMI intrinsic │
└──────────────────────────────────────────────────────────┘
│
▼ (Native HotSpot: generate_base64_decodeBlock)
┌──────────────────────────────────────────────────────────┐
│ Main Loop: Decodes 128 bytes ──► 96 output bytes │
│ Tail Handler (< 4 bytes left: "=") │
│ ├─ output_size = (len / 4) * 3 ──► 0 │
│ ├─ Padding branch decrements for '=' ──► output_size = -1
│ └─ BZHI mask reads low byte (255 > 64) ──► ALL 64 BITS SET
└──────────────────────────────────────────────────────────┘
│
▼ (~62-byte Out-of-Bounds Heap Write)
[Corrupts Adjacent Heap Object Header]
│
├──► Immediate IllegalArgumentException (does NOT undo write)
└──► Subsequent GC Crash (DoS) or Targeted Heap Exploitation (RCE)
Why the Tail Handler Overflows
As documented by Datadog Security Labs and VulnCheck, the AVX-512 main loop processes 64-byte input blocks into 48 output bytes. When fewer than 64 bytes remain, execution falls through to a tail-fragment handler.
Consider an input longer than 128 bytes ending in a malformed 1-byte padded fragment (such as = alone). decodedOutLength() allocates a 98-byte destination buffer, and the main loop writes 96 bytes for the first 128 characters. When the tail handler receives the lone =, it calculates the remaining output length via (len / 4) * 3 (which evaluates to 0), and then decrements output_size for the trailing = padding character without a non-negative bounds check, driving output_size to -1.
The intrinsic then uses the x86 BZHI instruction to build a 64-bit masked-store bitmask from output_size. Because BZHI reads the low byte of -1 (255), which exceeds the 64-bit operand width, it leaves all 64 bits set. The subsequent AVX-512 masked store writes across the boundary of the 98-byte array, overflowing roughly 62 bytes into adjacent heap memory (predominantly the repeating pattern 69 a6 9a from padded unused lanes). Even though the Java decoder immediately throws IllegalArgumentException, the native out-of-bounds write has already occurred and can corrupt neighboring object headers consulted later by the Garbage Collector.
Safe Read-Only Audit Commands
Before restarting production clusters, verify whether each host exposes avx512vbmi and inspect the live JVM flags of running Java processes:
# 1. Check whether the host or VM CPU exposes AVX-512 VBMI
grep -om1 -E 'avx512[_]?vbmi' /proc/cpuinfo
# 2. Check the Java runtime version on the host or inside a container
java -version
# Container example:
# kubectl exec <pod-name> -c <container-name> -- java -version
# 3. Inspect live JVM flags on a running Java PID to check Base64 intrinsics
jcmd -l
jcmd <PID> VM.flags -all | grep -E "UseBASE64Intrinsics|UseAVX"
If grep against /proc/cpuinfo returns no output, the CPU does not expose avx512vbmi and is not known to be affected.
Evidence: Affected Versions, Severity Discrepancy, and Exploitation Status
Affected OpenJDK Release Lines and Fixed Builds
Per Oracle's November 17, 2026 advisory and Datadog Security Labs, the following OpenJDK lines and downstream distributions (including Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine, Red Hat OpenJDK, and Oracle GraalVM for JDK) are impacted:
| Java Release Line | Affected Versions | First Fixed Release |
|---|---|---|
| Java 17 | 17.0.6 through versions before 17.0.21.1 |
17.0.21.1+4 |
| Java 21 | All versions before 21.0.13.1 |
21.0.13.1+4 |
| Java 25 | All versions before 25.0.5.1 |
25.0.5.1+4 |
| Java 27 | All versions before 27.0.1.1 |
27.0.1.1+4 |
OpenJDK 8 and OpenJDK 11 do not contain the AVX-512 Base64 intrinsic path and are unaffected.
Cross-Source Severity Discrepancy
Security teams should note a significant CVSS scoring divergence across primary advisories:
- Red Hat (
RHSB-2026-018): Assigns a CVSS v3 score of 9.8 (Critical), emphasizing that pre-authentication RCE has been demonstrated against widely deployed default Java applications such as Atlassian Jira, Confluence, Jenkins, and Keycloak when running on AVX-512 VBMI hardware. - Oracle: Assigns a CVSS v3.1 score of 8.1 (High), noting that the flaw is "difficult to exploit" across arbitrary targets. Under CVSS v4.0, Datadog cites a score of 9.2 (Critical).
- Exploitation Reality: Tenable reports that as of November 18, 2026, GreyNoise observed exploitation attempts against
CVE-2026-114938(without confirming successful compromise on its sensors), and VulnCheck noted that a working exploit is available to its customers.
Enterprise Application Impact Examples
- Keycloak: Keycloak's advisory confirms that container images
26.8.2-1and26.8.2-2bundle an affected OpenJDK21.0.13build, and the26.8.2Keycloak Operator bundles OpenJDK 25. Because Keycloak decodes Base64 on pre-authentication requests, login prompts do not protect unpatched nodes. - Elastic Stack: Elastic confirmed that Elasticsearch 7.17.3+ is vulnerable (authenticated read-access RCE or unauthenticated DoS) and Logstash 8.6.2+ is vulnerable to DoS when using
logstash-filter-elastic_integrationon untrusted Base64 fields. Fewer than 5% of Elastic Cloud Hosted deployments (specifically on Azure) ran affected CPUs, while AWS and GCP deployments were unaffected.
Hardening Playbook: CPU Checks, JVM Flags, and Patch Verification
Step 1: Inventory Java Runtimes and Host CPU Capabilities
Check every bare-metal host, VM, and Kubernetes node pool—especially cloud SKUs known to expose AVX-512 VBMI (such as AWS C6i/M6i/R6i/C7i/M7i/R7a, GCP C3/C3D/C4/C4D/N4/N4D/M3/M4, and Azure Dsv5/Dsv6/Dasv6/Dasv7). Remember to audit bundled JVMs inside container images and vendor appliances, not just the host's default java binary.
Step 2: Apply the Targeted JVM Workaround (-XX:-UseBASE64Intrinsics)
If you cannot immediately upgrade to a fixed OpenJDK build, start affected JVMs with -XX:-UseBASE64Intrinsics. This disables only the hardware-accelerated Base64 intrinsic while preserving all other AVX-512 optimizations:
# Example: Systemd / shell startup (append to existing JAVA_OPTS_APPEND)
export JAVA_OPTS_APPEND="${JAVA_OPTS_APPEND:+$JAVA_OPTS_APPEND }-XX:-UseBASE64Intrinsics"
# Example: Kubernetes / Docker environment variable
# -e JAVA_OPTS_APPEND=-XX:-UseBASE64Intrinsics
Important Warning: Avoid using -XX:UseAVX=2 in shared multi-architecture configs. Native ARM64 JVMs do not recognize UseAVX and will fail to start if that flag is present. Also never set -XX:+UseBASE64Intrinsics, which re-enables the vulnerable path.
Step 3: Verify the Running JVM Process
Setting an environment variable is not enough—confirm that the live process actually accepted the flag:
jcmd <PID> VM.flags -all | grep -F UseBASE64Intrinsics
# Expected output:
# bool UseBASE64Intrinsics = false {product} {command line}
For Elasticsearch, query GET _nodes/jvm and confirm -XX:-UseBASE64Intrinsics appears in jvm.input_arguments. For Keycloak Operator pods, remember to set JDK_JAVA_OPTIONS=-XX:-UseBASE64Intrinsics on the operator deployment separately from JAVA_OPTS_APPEND on the Keycloak server pods.
Step 4: Monitor for TMM/JVM Crash & Exploitation Telemetry
Alert on unexpected JVM restarts, OutOfMemoryError or SIGSEGV crash logs (hs_err_pid*.log) referencing generate_base64_decodeBlock or garbage collection failures, and elevated HTTP 400/500 responses containing malformed Base64 strings ending in = padding on Authorization, SAML, or CSRF headers.
Step 5: Upgrade to Patched Runtimes and Clean Rollback
Deploy vendor-patched OpenJDK builds (17.0.21.1+4, 21.0.13.1+4, 25.0.5.1+4, 27.0.1.1+4 or newer) and rebuild all custom container base images. Once the patched runtime is verified via java -version across all nodes, remove -XX:-UseBASE64Intrinsics during your next rolling restart. If a patched runtime introduces application regressions, keep -XX:-UseBASE64Intrinsics in place while rolling back to the prior container tag.
Frequently Asked Questions (FAQs)
1. Are ARM64 servers or older x86-64 CPUs vulnerable to Java4Shell?
No. CVE-2026-114938 only triggers when HotSpot selects the x86-64 AVX-512 VBMI Base64 intrinsic. ARM64 systems (such as AWS Graviton or Apple Silicon) and x86-64 processors older than Intel Ice Lake or AMD Zen 4 do not execute this code path.
2. Is Java 8 or Java 11 affected?
No. Red Hat and Oracle confirm that OpenJDK 8 and OpenJDK 11 do not contain the vulnerable AVX-512 Base64 intrinsic introduced in later releases (17.0.6+).
3. Does requiring authentication protect my Java application? Not necessarily. Many applications—including Keycloak, Jira, and SAML Service Providers—decode Base64-encoded HTTP Basic headers, SAML payloads, or CSRF tokens before authenticating the user.
4. Should I use -XX:-UseBASE64Intrinsics or -XX:UseAVX=2?
Use -XX:-UseBASE64Intrinsics. It is narrower, preserves other AVX-512 performance optimizations, and will not crash ARM64 JVMs if accidentally included in shared deployment manifests.
5. Why do Red Hat and Oracle list different CVSS scores for CVE-2026-114938? Red Hat scores it 9.8 (Critical) due to demonstrated pre-authentication RCE in common default Java applications on AVX-512 VBMI hardware, whereas Oracle scores it 8.1 (High) because reliable RCE requires application-specific heap conditions.
Sources
- Red Hat Security Bulletin (Primary): RHSB-2026-018 — Remote Code Execution via memory corruption on x86-64 systems - OpenJDK (CVE-2026-114938) (Created November 17, 2026; Updated November 18, 2026)
- Keycloak Official Advisory (Primary): Java4Shell: What Keycloak admins need to do (CVE-2026-114938) (Published November 18, 2026)
- Elastic Official Advisory (Primary): Java4Shell Remote Code Execution (RCE) Vulnerability - CVE-2026-114938 (Published November 18, 2026)
- Datadog Security Labs (Technical Analysis): Java4Shell: Remote Code Execution in OpenJDK (CVE-2026-114938) (Published November 17, 2026)
- VulnCheck (Technical Analysis): Java4Shell CVE-2026-114938: Fine, I Guess We'll Do This Again (Published November 18, 2026)
- Tenable (Threat & Exploitation Status): Java4Shell (CVE-2026-114938): OpenJDK RCE Vulnerability FAQ (Published November 18, 2026)
- Microsoft Azure Network Security (Cloud Guidance): Addressing Java4Shell CVE-2026-114938: upgrade guidance and Azure WAF mitigations (Published November 18, 2026)