Java4Shell (CVE-2026-114938): Investigation and Detection Strategies for OpenJDK Base64 Heap Overflow

Java4Shell (CVE-2026-114938) is an OpenJDK Base64 heap overflow. See our Jenkins lab findings, mitigation steps, and Versa IPS coverage.

Summary

Java4Shell (CVE-2026-114938) is a critical OpenJDK vulnerability. An integer underflow in the AVX-512 VBMI Base64 decoding intrinsic can cause a heap buffer overflow and potentially lead to remote code execution (RCE). We investigated how malformed Base64 trigger requests could reach Java applications through HTTP authentication flows. Our Docker-based lab included a vulnerable Jenkins LTS application. We generated and captured baseline and malicious traffic, observed the HTTP responses, and examined the resulting PCAPs. We did not confirm exploitation. The findings show the potential security impact of Java4Shell and the challenges of validating its exploitability through application-level testing. This post covers detection, mitigation, and Versa IPS coverage.

  • Java4Shell targets an optimized Base64 decoding intrinsic in OpenJDK HotSpot, and exploitability depends on AVX-512 VBMI CPU instruction support.
  • A specially crafted Base64 input can trigger the vulnerable decoding logic, potentially causing an integer underflow and a heap buffer overflow.
  • The resulting memory corruption may provide a pathway to remote code execution, depending on the target JVM, application context, and exploit conditions.
  • Our lab investigation examined trigger-request delivery against a vulnerable Java application, Jenkins LTS.
  • We used PCAP analysis to inspect the HTTP request patterns, Base64 payloads, and application-level responses, providing network-level evidence of trigger delivery.
  • Confirming successful exploitation requires evidence beyond network traffic, such as JVM-level memory corruption, process instability, or demonstrated code execution.
  • Recommended mitigations include upgrading to a fixed OpenJDK release or temporarily disabling the affected Base64 decoding intrinsic.

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.

Jenkins LTS testing results showing successful delivery of malformed Base64 trigger payloads

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

Wireshark capture of a legitimate Jenkins /api/json request using Basic Authentication
Wireshark capture of the crafted Jenkins /api/json request containing the malformed Base64 payload in the HTTP Basic Authentication header

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

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.

Disha Sharma

By Disha Sharma

Security Engineer - Research

Disha Sharma is a Security Engineer on the Research team at Versa Networks, focusing on cybersecurity research, vulnerability analysis, and network threat detection.

Subscribe to the Versa Blog

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.