Skip to content
GHMyGearHut
AIDispatch2 min read

Java4Shell: A Base64-Driven RCE in OpenJDK

Java4Shell (CVE-2026-114938) is a memory-corruption flaw in OpenJDK’s Base64 decoder that can give remote code execution without credentials. The bug lets an attacker send a short malformed Base64 string and overwrite heap memory, exposing data or running arbitrary code in many Java services.

By Miraz·2026-11-18

Evidence: source-based coverage unless the article documents its own test method, setup, and results. Editorial policy and corrections

Java4Shell: A Base64-Driven RCE in OpenJDK

Java4Shell (CVE-2026-114938) is a memory-corruption flaw in OpenJDK’s Base64 decoder that can give remote code execution without credentials. The bug lets an attacker send a short malformed Base64 string and overwrite heap memory, exposing data or running arbitrary code in many Java services.

What the Vulnerability Is

The flaw lives in the hand-rolled assembly code that powers Base64 decoding on x86-64 processors. OpenJDK optimizes the routine with AVX-512 VBMI instructions, processing large blocks of data in a single native call. A miscalculation in the padded tail’s store mask lets the decoder write past the end of a result buffer when the input ends with a single “=”. For the trigger payload of 64 “A” characters followed by “=”, OpenJDK allocates a 50-byte array. The routine then writes 64 bytes starting at offset 48, corrupting the heap beyond the array’s bounds. Older OpenJDK 17 builds trigger the same path with 128 “A” characters followed by “=”, because the threshold to reach the optimized code path is higher.

The bug is a classic out-of-bounds write that can leak memory in a Heartbleed-style read or be turned into remote code execution with additional heap manipulation.

Triggering the Bug

A minimal payload looks like:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=

Sending this string to any component that calls the Base64 decoder can overwrite neighboring objects on the heap. The corruption can expose sensitive data or be leveraged into arbitrary code execution, depending on the application’s memory layout and control flow.

Impact on Java Applications

The vulnerability has been demonstrated in a range of widely deployed Java services in their default configurations:

  • Pre-auth RCE: Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins, PingFederate
  • Post-auth RCE: Apache Kafka Broker, Apache Solr, Elasticsearch, Gerrit, Spinnaker

The bug also affects applications built on common frameworks such as Apache Struts and Spring Boot. Ordinary features—authentication, file uploads, or TLS connections—can expose the vulnerable decoder, extending the potential impact far beyond the products listed.

Exploitation Path

The initial out-of-bounds write is a fixed-value linear write that cannot be directly controlled. Attackers use a classic buffer-length overwrite primitive, similar to techniques used in JavaScript engines, to turn the fixed write into a bounded, chosen-value linear write. By aligning the heap with Heap Feng Shui, they first leak sensitive data (a JavaBleed primitive) and then corrupt a Code Cache or JVM hook to achieve arbitrary code execution. The chain requires no credentials and can be launched from a Java client that opens a TLS connection to a malicious server.

Mitigation and Patch Status

The only reliable mitigation is to update OpenJDK to a version that removes the buggy intrinsic. Patches are available from the OpenJDK maintainers. Systems that rely on the Base64 decoder for authentication or data transfer should verify that their runtime is patched before exposing services to untrusted input.

Open Questions

The source does not indicate whether the bug affects all OpenJDK distributions or only the upstream build. It also does not provide a list of all downstream products that may still carry the vulnerable code. Monitoring the OpenJDK release notes and scanning for the specific assembly code remains the best practice.

Sources

Written with AI assistance from the cited sources, fact-checked automatically and approved by an editor before publishing.

[APPLIED ADVISORY]

Need this architecture deployed in your organization?

MyGearHut consults and builds custom AI agents, automated operations pipelines, and private inference infrastructure.