Security & privacy

Java4Shell vulnerability exploits Base64 decoder in OpenJDK

A critical memory-corruption flaw in OpenJDK's Base64 decoder allows remote code execution on specific x86-64 hardware. Patching and WAF rules are required to mitigate CVE-2026-114938.

Illustration of a cracked Java runtime cube with leaking binary code
Illustration generated for this article

On November 17, 2026, security researchers at Calif disclosed Java4Shell (CVE-2026-114938), a critical memory-corruption vulnerability in the OpenJDK runtime. The flaw, which scores 9.2 out of 10 on the CVSS 4.0 scale, allows unauthenticated attackers to execute arbitrary code by sending malformed Base64 data to vulnerable Java applications. Oracle and OpenJDK released patches the same day, but the window for exploitation remains open for unpatched systems running on specific modern processors.

What happened

The vulnerability resides in the Base64 decoder of OpenJDK, the most widely used Java runtime environment. When an application processes attacker-controlled Base64 input, such as authentication headers or file uploads, the decoder can be tricked into writing data beyond the allocated memory buffer. This overflow allows an attacker to overwrite adjacent memory structures on the Java heap. Calif demonstrated that this corruption could be leveraged to leak sensitive heap memory or achieve full remote code execution (RCE).

Calif successfully demonstrated pre-authentication RCE against several popular enterprise applications, including Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins, and PingFederate in their default configurations. Post-authentication RCE was also achieved against Apache Kafka, Apache Solr, Elasticsearch, Gerrit, and Spinnaker. The ease of exploitation is concerning; Calif reported developing a working local exploit in approximately three hours with the assistance of AI agents, suggesting that sophisticated attack chains will emerge rapidly.

Oracle released patched builds in its November 2026 Critical Patch Update at 21:00 UTC on the day of disclosure. However, patching is complex because many applications bundle their own Java runtime, and container images often ship with fixed JDK versions. Simply upgrading the system-level Java package does not update these bundled copies, and any running Java Virtual Machine (JVM) must be restarted to apply the fix.

How it works

The root cause lies in a performance optimization within OpenJDK. To accelerate Base64 decoding, the runtime uses specialized machine code instructions called intrinsics. On supported x86-64 processors with AVX-512 VBMI support, the decoder processes 64 bytes of data at a time using handwritten assembly code. The bug occurs in the logic handling the final characters of the input string.

When the tail of the Base64 input contains padding characters (=) in an invalid position, the routine miscalculates the output length, resulting in a negative value. This invalid length is interpreted as a large positive integer, causing the decoder to write up to 64 bytes past the end of the allocated output array. For example, a 65-character input consisting of 64 valid characters followed by a single equals sign triggers a write of 62 bytes beyond the 50-byte buffer allocated by the JVM. Although Java eventually throws an exception for the invalid input, the memory corruption has already occurred.

Exploitation requires careful manipulation of the Java heap. Attackers must arrange memory objects so that the overflow enlarges neighboring arrays, granting them read and write primitives. This process, known as heap grooming, allows the attacker to control execution flow. The vulnerability only affects systems running OpenJDK 17.0.6 or newer on x86-64 processors with AVX-512 VBMI support, such as Intel Xeon Ice Lake and newer, or AMD EPYC Zen 4 and newer. ARM64 processors are not affected.

Key details

  • Vulnerability ID: CVE-2026-114938 (Java4Shell)
  • Severity: Critical (CVSS 4.0 score: 9.2)
  • Affected Runtimes: OpenJDK 17.0.6+, including Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, and Oracle Java SE
  • Hardware Requirement: x86-64 processors with AVX-512 VBMI support (Intel Ice Lake+, AMD Zen 4+)
  • Trigger: Malformed Base64 input with padding characters in invalid positions
  • Mitigation: Patch OpenJDK, restart services, or disable intrinsics via JVM flags

Why it matters

For software engineers and infrastructure teams, Java4Shell represents a significant risk because it bypasses traditional application-level input validation. The corruption occurs inside the JVM’s native code before the Java application can reject the invalid data. This means that even well-written applications with strict input sanitization are vulnerable if they use the standard Java Base64 decoder on affected hardware. The widespread use of Java in enterprise backends, combined with the prevalence of bundled JDKs in containerized environments, makes comprehensive patching difficult and slow.

The reliance on hardware-specific optimizations also complicates detection and mitigation. Systems without AVX-512 support are immune, but identifying which servers in a large fleet run on vulnerable processors requires detailed inventory management. Furthermore, the vulnerability can be exploited through non-HTTP protocols, such as Apache Kafka’s native protocol, meaning that web application firewalls alone cannot provide complete protection. Teams must adopt a defense-in-depth strategy that includes runtime patching, network-level filtering, and careful monitoring of heap behavior.

What you can do

  • Patch immediately: Update all OpenJDK installations to the latest version from your vendor (Oracle, Amazon, Eclipse, etc.) and restart all Java services.
  • Apply temporary mitigations: If immediate patching is not possible, add -XX:-UseBASE64Intrinsics to your JVM startup flags to disable the vulnerable code path. On x86-64 systems, you can also use -XX:UseAVX=2 to disable AVX-512.
  • Enable WAF rules: If you use Cloudflare, enable the new managed rules for CVE-2026-114938 in Log mode to detect malformed Base64 patterns. Review matches in Security Events before switching to Block action to avoid false positives.
  • Inventory your runtimes: Identify all applications bundling their own JDKs and container images with fixed Java versions. Ensure these are updated and redeployed.
  • Monitor for exploitation: Watch for unusual heap activity or unexpected outbound connections from Java services, which may indicate successful exploitation.
  • Layer defenses: Use WAF Attack Score to detect multi-stage exploit chains that may bypass signature-based rules, particularly for post-exploitation command traffic.
  • #java
  • #security
  • #vulnerability
  • #openjdk
  • #waf
  • #infrastructure

Tools from the Bytechap store

Keep reading

All stories