Security & privacy

Critical OpenJDK vulnerability enables remote code execution via Base64 decoding

A memory-corruption bug in OpenJDK's Base64 decoder allows attackers to execute remote code on Java applications, affecting major enterprise software.

Illustration of Java security vulnerability with broken shield and server racks
Illustration generated for this article

Security researchers have disclosed a critical remote code execution vulnerability in OpenJDK, the most widely used Java runtime environment. Identified as CVE-2026-114938 and named Java4Shell, this flaw resides in the Base64 decoder and carries a CVSS 4.0 score of 9.2. The discovery highlights how low-level optimizations in high-level languages can introduce severe security risks to critical infrastructure.

What happened

The vulnerability was discovered by researchers at Calif, who utilized AI-assisted auditing tools to identify the bug in OpenJDK’s x86-64 Base64 intrinsic. This specific component uses specialized CPU instructions to accelerate data decoding. The flaw allows malformed input to overwrite neighboring memory, potentially leading to information leaks or full remote code execution (RCE). The trigger is surprisingly simple: a string of 64 'A' characters followed by a single equals sign can exploit the bug in newer versions, while older OpenJDK 17 builds require 128 'A' characters.

Java powers approximately 90% of Fortune 500 companies, underpinning sectors such as banking, aviation, and telecommunications. Because Base64 encoding is ubiquitous in authentication protocols, file uploads, and network messaging, the attack surface is extensive. The researchers demonstrated successful pre-authentication RCE in widely deployed applications including Keycloak, Atlassian Jira, Confluence, JFrog Artifactory, Jenkins, and PingFederate. Post-authentication exploitation was also confirmed in Apache Kafka, Solr, Elasticsearch, Gerrit, and Spinnaker.

The impact extends beyond server-side applications. A client-side exploit was also demonstrated, showing that a Java program establishing a TLS connection to a malicious server could be compromised even if it does not expose any services itself. This indicates that any Java application processing untrusted Base64 data is potentially vulnerable, regardless of its network configuration.

How it works

Java is often praised for its memory safety, as the virtual machine manages memory allocation and access checks. However, the core runtime and performance-critical components are written in lower-level languages like C, C++, and assembly. To speed up Base64 decoding, OpenJDK employs AVX-512 VBMI instructions on supported processors. The bug exists in the hand-rolled assembly code responsible for handling the final few characters of a data block.

When processing a specific malformed input, the decoder miscalculates the output length due to padding characters. For a 65-character input, the system allocates a 50-byte buffer. However, the assembly routine mishandles the stray equals sign, resulting in a negative output length calculation. This invalid length causes the processor to write 64 bytes of data, overflowing the allocated buffer by 14 bytes. Although Java eventually rejects the invalid input, the memory corruption has already occurred, allowing attackers to manipulate heap structures.

Exploiting this vulnerability requires precise control over memory layout, a technique known as Heap Feng Shui. The overwrite is constant-value, meaning attackers cannot write arbitrary data but can control where the write occurs. By aligning memory allocations carefully, attackers can turn this limited overwrite into a heap leak and subsequently achieve remote code execution. The complexity varies depending on the application, but the underlying mechanism remains consistent across affected systems.

Key details

  • Vulnerability ID: CVE-2026-114938, named Java4Shell.
  • Severity: Critical, with a CVSS 4.0 score of 9.2.
  • Affected Component: OpenJDK HotSpot x86-64 Base64 intrinsic using AVX-512 instructions.
  • Trigger Input: 64 'A' characters followed by '=' for newer versions; 128 'A' characters followed by '=' for OpenJDK 17.
  • Impact: Remote code execution in default configurations of major enterprise software like Jira, Jenkins, and Kafka.
  • Discovery Method: AI-assisted code auditing by researchers at Calif, taking approximately three hours total.

Why it matters

This incident underscores the hidden risks of performance optimizations in shared software stacks. Features designed to benefit specific high-throughput use cases are distributed to all users, increasing the attack surface for applications that may never utilize those optimizations. In this case, the accelerated Base64 decoder introduced a memory-corruption vector into a language prized for its safety guarantees. Developers and IT leaders must recognize that high-level abstractions do not eliminate low-level vulnerabilities when native code is involved.

For engineering teams, the immediate implication is the need to audit any Java application that processes external Base64 data. Since the vulnerability can be triggered through common features like file uploads and authentication tokens, many services may be exposed without obvious signs. The demonstration of client-side exploits further expands the threat model, suggesting that even internal tools connecting to external services could be compromised. This reinforces the importance of keeping runtimes updated and monitoring for unusual memory behavior.

What you can do

  • Update OpenJDK to the latest patched version immediately across all production and development environments.
  • Audit applications for any usage of Base64 decoding on untrusted or user-supplied input.
  • Implement strict input validation to reject malformed Base64 strings before they reach the decoder.
  • Monitor security advisories for affected third-party applications like Jira, Jenkins, and Kafka.
  • Consider disabling AVX-512 optimizations if performance impact is acceptable and patching is delayed.
  • Review client-side Java applications that establish outbound TLS connections to untrusted servers.
  • #java
  • #security
  • #openjdk
  • #vulnerability
  • #enterprise

Tools from the Bytechap store

Keep reading

All stories