Security

Java4Shell Critical Vulnerability Affects OpenJDK Base64 Decoder

A critical memory-corruption flaw in OpenJDK's Base64 decoder allows unauthenticated remote code execution on affected systems; Cloudflare releases WAF rules to detect exploitation attempts.

4 min readSource: Cloudflare Blog

Curated by Kandala Guruprasad. Drafted with AI and checked against the source.

Java4Shell Critical Vulnerability Affects OpenJDK Base64 Decoder

TL;DR

  • Java4Shell (CVE-2026-114938) is a critical memory-corruption vulnerability in OpenJDK's Base64 decoder that enables remote code execution on systems running OpenJDK 17.0.6 or newer with AVX-512 processors.
  • The flaw affects multiple enterprise applications including Keycloak, Jira, Confluence, Artifactory, Jenkins, Kafka, Solr, and Elasticsearch when they process attacker-controlled Base64 input.
  • Cloudflare released six managed WAF rules to detect malformed Base64 patterns associated with the exploit, enabled by default in Log mode on Pro, Business, and Enterprise plans.
  • Patching the Java runtime is the only complete fix; mitigation flags like -XX:-UseBASE64Intrinsics can reduce exposure while updates are deployed.
CVSS Score
9.2 (Critical)
Affected Runtime
OpenJDK 17.0.6 and newer
Affected Processors
x86-64 with AVX-512 VBMI support

What Happened

On November 17, 2026, security researcher Calif disclosed Java4Shell (CVE-2026-114938), a critical memory-corruption vulnerability in the Base64 decoder of OpenJDK. The flaw scores 9.2 out of 10 under CVSS 4.0. OpenJDK published a security advisory and Oracle released patched builds in its November 2026 Critical Patch Update the same day at 21:00 UTC.

Calif demonstrated that the vulnerability enables both pre-authentication and post-authentication remote code execution against a range of widely-used enterprise applications. Pre-authentication RCE was shown against Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins, and PingFederate in their default configurations. Post-authentication RCE was demonstrated against Apache Kafka, Apache Solr, Elasticsearch, Gerrit, and Spinnaker.

How the Vulnerability Works

The flaw exists in handwritten assembly code that handles the final characters of Base64 input on supported x86-64 processors. OpenJDK uses AVX-512 instructions to process Base64 data 64 bytes at a time for performance. When the tail of input contains padding characters (=) in positions where valid Base64 never places them, the routine calculates a negative output length, which turns into a full 64-byte write past the allocated buffer.

For example, 64 A characters followed by a single = will trigger the overflow. On OpenJDK 17, the trigger requires 128 characters followed by =. The corruption occurs inside the decoder before the application can reject the data, so an application's own input validation provides no protection.

Exploitation requires arranging the Java heap so the overflow enlarges neighboring arrays, allowing first a way to read heap memory and then a way to write chosen bytes. Each target application requires its own exploit chain. Calif reported developing its first working local exploit in approximately three hours with AI agent assistance, suggesting other attackers may build working exploit chains quickly.

Who Is Affected

Java4Shell affects a system only when all of the following conditions are met. The Java runtime must be OpenJDK 17.0.6 or newer, including distributions built from OpenJDK such as Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine, Red Hat OpenJDK, Oracle OpenJDK, Oracle Java SE, and Oracle GraalVM for JDK.

The processor must be x86-64 with AVX-512 VBMI support, such as Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids or Granite Rapids, or AMD EPYC and Ryzen Zen 4 or newer. ARM64 processors are not affected. Finally, the application must decode attacker-controlled Base64 data with the standard Java decoder. Many applications bundle their own Java runtime in containers or as part of their distribution, so upgrading the system Java package does not update those copies or running JVMs. Every updated service needs a restart.

Cloudflare WAF Protection

Cloudflare released six new managed rules designed to detect malformed Base64 input patterns associated with Java4Shell. The rules are available on Pro, Business, and Enterprise plans and are enabled by default with the Log action. Because malformed input and some benign application-specific token formats can resemble exploitation attempts, blocking by default could disrupt legitimate traffic. Customers can review matching requests in Security Events and change the rules action to Block once they confirm it does not affect legitimate traffic.

The rules detect malformed Base64 in HTTP headers, query values, body values, path segments, JWT components, and WebAuthn values. Cloudflare noted that a WAF is an additional layer of defense, not a replacement for patching. Java4Shell can be reached through paths a WAF does not see, including encoded or nested data, non-HTTP protocols, outbound TLS connections, and traffic that bypasses Cloudflare entirely. The only complete fix is to update the Java runtime.

Temporary Mitigation

If immediate patching is not possible, two JVM startup flags can remove the vulnerable code path. The flag -XX:-UseBASE64Intrinsics disables hardware-accelerated Base64 encoding and decoding. The flag -XX:UseAVX=2 disables AVX-512 and should be applied only on x86-64 hosts; OpenJDK on ARM does not recognize it and will fail to start. Both flags require a restart and may reduce performance for workloads that decode large amounts of Base64. They buy time while you patch but do not replace the update.

What to Do

Prioritize updating every Java runtime to a patched version. Focus on systems running OpenJDK 17.0.6 or newer on x86-64 processors with AVX-512 support that process untrusted Base64 input. For applications with bundled JDKs or container images, verify those also receive updates. While patching, enable Cloudflare WAF rules to log and monitor matching traffic. Review the Security Events in the Cloudflare dashboard filtered by the Java4Shell rule IDs. Once you confirm the rule matches do not affect legitimate traffic, switch the rule action from Log to Block. For Enterprise customers with access to WAF Attack Score, consider enabling the remote code execution sub-score (cf.waf.score.rce) for additional detection of multi-stage exploit chains that pair the initial Base64 trigger with secondary payloads.

Source

Cloudflare Bloghttps://blog.cloudflare.com/java4shell-waf-protection/

AI-assisted, verified against the source. This post was drafted with AI from the primary source linked above and checked automatically against it. For anything you depend on, read the original.

  • #java
  • #openjdk
  • #vulnerability
  • #cve-2026-114938
  • #wafprotection

More in Security