Java4Shell (CVE-2026-114938) at a glance
- CVE: CVE-2026-114938
- Vulnerability: Integer underflow leading to heap buffer overflow and potential remote code execution
- Affected component: OpenJDK HotSpot AVX-512 VBMI Base64 decoding intrinsic
- CWE: CWE-191 and CWE-122
- Trigger: Malformed Base64 input
- Potential impact: Memory corruption and, under suitable conditions, remote code execution
- Lab target: Jenkins LTS Basic Authentication API endpoint
- Testing approach: HTTP trigger requests, response analysis, and PCAP capture
- Lab outcome: Trigger traffic delivered and captured; no confirmed application-level memory corruption or RCE observed
Executive summary
Java4Shell, tracked as CVE-2026-114938, concerns a memory-corruption issue in the OpenJDK HotSpot implementation of the AVX-512 VBMI-optimized Base64 decoding routine.
The underlying issue involves an integer underflow during the calculation of the output mask for a malformed Base64 input. Under the affected execution path, this can result in a write extending beyond the intended heap buffer.
What makes this vulnerability particularly interesting from a network security perspective is the number of application features that process Base64 data. HTTP Basic Authentication, token processing, and other application-level decoding paths can bring attacker-controlled input into Java’s Base64 decoder.
We wanted to understand how this issue could be exercised through real application interfaces rather than limiting the investigation to a standalone Java proof of concept.
We therefore built a Docker-based lab with a vulnerable Java application, Jenkins LTS. We sent malformed Base64 trigger requests through its HTTP interfaces and captured the resulting traffic for analysis. We received a 200 OK response from the vulnerable Jenkins instance after delivering the trigger.
Hardware limitation: The vulnerable decoding path depends on AVX-512 VBMI support and is relevant to x86-64 systems running on supported processors, including Intel Ice Lake and newer architectures (Xeon 3rd Gen+) and AMD Zen 4 and newer architectures (EPYC Genoa / Ryzen 7000+). ARM64 systems are not affected by this specific vulnerability.
Technical analysis
Understanding the OpenJDK Base64 decoding issue
Java4Shell resides in the optimized Base64 decoding implementation inside OpenJDK HotSpot. The vulnerable execution path is associated with StubGenerator::generate_base64_decodeBlock() and the AVX-512 VBMI instruction set.
The decoder processes input in 64-byte chunks using vector instructions. Once the main processing loop finishes, a tail handler handles any remaining bytes that do not form a complete 64-byte block. The vulnerability occurs when this tail handler calculates the remaining decoded output size for a malformed Base64 input.
For JDK 21 and later, the reported trigger is a 65-byte input consisting of 64 A characters followed by a single =:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
The important detail is that this is not a structurally valid Base64 string. Base64 encodes data in groups of four characters, with padding permitted only at the end of a properly formed final group. Here, the first 64 characters already form complete groups, while the additional = is left on its own as a one-byte remainder.
A legitimate Base64 input with valid padding does not produce this same remainder condition. The decoder should calculate a non-negative output length for valid input. The vulnerability is triggered by how the optimized implementation handles the malformed trailing padding.
The tail handler calculates the expected output size from the remaining input length. With only one byte left, the calculation is effectively (1 / 4) * 3. Because integer division truncates the fractional result, 1 / 4 evaluates to zero, leaving an initial output size of zero. The decoder then encounters the padding character and applies its padding adjustment by subtracting one from the output size. This changes the value from zero to negative one (0 - 1 = -1).
This is the critical integer underflow. When the negative value is interpreted as a 64-bit unsigned integer, it becomes 0xFFFFFFFFFFFFFFFF, rather than a small output length. That value is subsequently used in the mask calculation involving the x86 BZHI (Zero High Bits) instruction.
The underflowed value produces an index of 0xFF (255) for the BZHI instruction. Since this exceeds the 64-bit register width, no bits are cleared, resulting in an all-ones mask (0xFFFFFFFFFFFFFFFF). The subsequent VMOVDQU8 instruction therefore writes the entire 64-byte vector, rather than limiting the write to the available output space. Starting at destination offset 48, the write extends beyond the 50-byte allocated buffer, resulting in a 62-byte heap buffer overflow. For OpenJDK 17, the trigger is 128 bytes.
Lab environment and testing approach
We created a Docker-based environment containing a vulnerable Jenkins LTS instance and aimed to test it through the Basic Authentication endpoint API. The goal of this phase was to establish how the application handled the trigger traffic and to preserve network evidence for subsequent detection research. We captured traffic for the target and retained separate PCAP files for analysis. This allowed us to inspect the HTTP requests, authentication headers, response codes, and TCP-level behavior. We used warm-up requests before sending the trigger attempts, following the test workflow used in the research material.
Lab observations
The Jenkins test log documents 50 successful warm-up authentication requests followed by four malformed Base64 trigger attempts using the JDK 21 and JDK 17 payload variants. No server errors, crash indicators, or heap-leak indicators were observed during the test. The output records the trigger payloads as delivered, but does not independently confirm heap corruption or successful exploitation.

For Jenkins, we included Wireshark screenshots documenting legitimate application traffic before injection and the crafted malicious traffic after injection. These captures provide a comparative view of the normal and modified request patterns, highlighting the Base64 payload introduced during testing.
PCAP analysis of trigger traffic


The captures are useful for examining:
- The HTTP methods and request paths used during testing.
- The presence of the authentication headers carrying the Base64 input.
- The request sequence, including warm-up and trigger attempts.
- The HTTP response codes returned by the applications.
- TCP connection behaviour during the exchange.
From a detection-engineering perspective, the malformed Base64 value is a useful network-level indicator. However, a detection rule should not rely solely on an application’s response code to determine whether exploitation succeeded.
A network sensor can identify suspicious input and report a potential exploitation attempt. Confirming memory corruption requires additional evidence from the target process, such as a reproducible bounded corruption test, JVM crash artifacts, or other application-level telemetry.
Our HTTP tests focused on request delivery and response behaviour. They should not be confused with a completed end-to-end exploit chain.
Video 1: Java4Shell demonstration showing payload delivery, network traffic, and Versa IPS alerting
Recommended mitigation approach for Java4Shell
Upgrade affected Java runtimes
The primary mitigation is to move to a fixed Java release.
The research material identifies the following fixed versions:
| JDK branch | Fixed version |
|---|---|
| JDK 17 | 17.0.21.1 |
| JDK 21 | 21.0.13.1 |
| JDK 25 | 25.0.5.1 |
| JDK 27 | 27.0.1.1 |
Organizations should verify vendor-specific advisories and backports rather than relying only on the upstream version number.
Disable the Base64 intrinsic as an interim measure
Where an immediate upgrade is not possible, the research material identifies the following JVM option as a narrower interim mitigation:
-XX:-UseBASE64Intrinsics
This disables the affected Base64 intrinsic. The setting should be applied consistently to the relevant Java processes, followed by a restart.
The alternative of disabling AVX-512 more broadly has a wider performance and compatibility impact and should be evaluated carefully.
Review embedded Java runtimes
Java is frequently bundled inside application containers and appliances. Updating a host-level Java installation does not necessarily update the runtime used by a containerized application.
Organizations should inventory Java runtimes in application images, services, and embedded deployments, and rebuild or replace affected images after applying the fix.
Versa’s perspective: detection opportunities
Java4Shell also presents a useful network-detection challenge.
The malformed Base64 trigger can appear in HTTP authentication traffic, making request inspection relevant to identifying potential exploitation attempts.
Detection can consider several signals together:
- Suspicious Base64 padding and malformed input lengths.
- Known trigger patterns associated with affected JDK branches.
- Repeated authentication requests that may form part of a warm-up sequence.
- Unusual request frequency or repeated attempts from a single source.
For IPS coverage, the objective is to identify and block suspicious trigger traffic before it reaches the application, while avoiding unnecessary disruption to legitimate authentication requests.
Versa Networks Protections Against Java4Shell – Heap Overflow in OpenJDK
Available from Versa Spack: 2395
| SID (Signature Identifier) | CVE(s) Covered |
|---|---|
| 1000033877, 1000033878 | CVE-2026-114938 |
Summary
Java4Shell demonstrates how a low-level optimization in a widely used runtime can introduce security risks for network-facing applications. Our investigation extended beyond the standalone trigger to test malformed Base64 requests against Jenkins LTS, with traffic captured for the test. The results provide insight into how crafted trigger traffic interacts with a Java application interface while highlighting that request delivery, application response, memory corruption, and remote code execution represent distinct stages of exploit validation. For defenders, the immediate priorities are to inventory potentially affected Java runtimes, verify the underlying CPU and JVM conditions, apply the relevant security updates, and use network-level detection as an additional layer of protection during remediation.