Back to blog

Java4Shell (CVE-2026-114938) Analysis and Remediation

Contrast ADR now blocks Java4Shell at runtime

TL;DR

Java4Shell is a heap overflow in the Base64 decoder inside OpenJDK 17.0.6 and later, rated 9.2 under CVSS 4.0 and disclosed by Calif on November 17, 2026. It lives in the Java runtime, so SCA and SAST cannot see it. Oracle has shipped fixed builds, but most other JDK vendors have not. Contrast ADR blocks exploit attempts inside the JVM now, so you are protected while you patch.

Introduction

Oracle patched 11 Java SE vulnerabilities on November 17. One of them is Java4Shell. Calif, the same firm that disclosed PHP2Shell last month, published the details the same morning. The triggering input is only 65 bytes long, and Base64 is how JWTs, HTTP Basic Auth headers and SAML assertions cross the wire. That means the vulnerable decoder runs on untrusted input in nearly every Java service with a login.

What is Java4Shell and why it matters

OpenJDK replaces the Java implementation of java.util.Base64 with a hand-written x86 intrinsic on CPUs that support AVX-512 VBMI. That includes Intel Ice Lake and newer and AMD Zen 4 and newer. On those CPUs, a crafted 65-byte padded input causes the intrinsic to miscalculate its store mask. It then writes 64 bytes past the end of a 50-byte buffer. Calif reports this can leak memory or lead to unauthenticated remote code execution.

A few key figures define the scope of CVE-2026-114938:

  • CVSS 4.0 score: 9.2
  • Affected Java lines: 17, 21, 25 and 27
  • Trigger size: 65 bytes
  • Unaffected environments: Java 8 and 11 do not contain the intrinsic, and non-AVX-512 ARM hosts do not run the vulnerable execution path.
  • Threat status: No active exploitation has been reported in the wild, and the CVE is not currently listed in CISA KEV.

How the Java4Shell exploit works

An attacker sends a crafted Base64 string anywhere the application decodes attacker-supplied input. Typical paths include an Authorization header, a JWT segment, a SAML assertion or a file upload. If the JVM has JIT-compiled the decoder, which is true on any busy service, the intrinsic runs and corrupts the heap. A failed attempt usually crashes the JVM. A successful one can give the attacker code execution.

The patching timeline challenge

Oracle JDK users can fix this today. Temurin, Corretto, Zulu, Microsoft, Red Hat and the Linux distributions had not shipped a build naming the CVE as of the evening of November 17. Most companies run those free distributions, so many teams face a gap of days. Updating your application does not update the runtime beneath it. JDKs bundled in container images and application distributions will not appear in package manager queries.

Static analysis and SCA limitations

There is no vulnerable dependency for SCA to flag and no line of your code for SAST to point at. A clean scan result tells you nothing about this bug. Only runtime inventory by vendor and exact build string tells you where you stand.

Web application firewalls cannot see where it matters

A WAF does not know which JDK runs behind it, whether the payload will reach the vectorized decoder, or what the buffer offsets are at execution time. Base64 payloads also arrive in headers, tokens and uploads in many encodings. The decision has to be made at the point of execution, inside the JVM.

How Contrast provides protection today

Contrast ADR includes a Java4Shell rule in the Contrast Java agent, version 6.38.0 or later. The rule runs where Base64 decoding happens. It first checks the host JDK version and only evaluates inputs on affected runtimes. On a vulnerable JDK, it inspects each decode call for the structural pattern that triggers the overflow.

In block mode, a matching input is stopped before it reaches the vulnerable intrinsic. In monitor mode, the attempt is logged as an attack event. Valid Base64 does not match the signature, so normal traffic passes with no behavioral impact.

ADR is a runtime mitigation that buys you time. Upgrading to a JDK build containing the upstream fix, tracked as JDK-8393212, remains the permanent resolution.

Detection and remediation strategy

Organizations should follow a disciplined five-step remediation approach:

  1. Comprehensive discovery: Inventory every JVM by vendor and exact build string, including runtimes inside containers and bundled products.
  2. Determine actual exploitability: Check hardware. Hosts without AVX-512 VBMI do not execute the vulnerable path. On Linux, look for avx512f, avx512bw, avx512vbmi and bmi2 in the CPU flags. Then prioritize internet-facing services that decode Base64 from requests.
  3. Strategic patching: Move Oracle JDK to a fixed build now. For other distributions, wait for a release whose notes name CVE-2026-114938, then restart and confirm the running version with java -version.
  4. Deploy runtime protection: Install Java agent 6.38.0 or later and enable the Java4Shell rule in block mode, starting with internet-facing applications. If you can neither patch nor run the agent on a host, adding -XX:-UseBASE64Intrinsics to the JVM options and restarting disables the vulnerable decoder. It may reduce performance, so remove it once the patched runtime is in place.
  5. Continuous monitoring: Hunt for hs_err_pid files, SIGSEGV entries and unexplained JVM restarts since November 16. Search access logs for 65-character or 129-character Base64 strings in Authorization headers, cookies and upload bodies. Treat any hit as a compromised host.

The persistent threat

Runtime bugs outlive the news cycle. JDKs get baked into images that nobody rebuilds, and bundled runtimes sit inside products for years. Attackers know a public crash trigger is a head start for building a working exploit.

Building long-term defense

The lesson is that vulnerability management cannot stop at the dependency list. Teams need an inventory that includes the runtime, and protection that works at the point of execution. Layering runtime protection over a disciplined patch process lets you respond in hours instead of waiting on every vendor.

Conclusion and next steps

Java4Shell is serious, but it is manageable. Patch the runtime, inventory by exact build, and put protection in front of your most exposed services today. Contrast gives you that protection while the rest of the ecosystem catches up.

Key takeaways

  • The flaw is in the JVM, not in a library or your code.
  • Oracle's fixed builds are 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Other distributions will ship different version numbers.
  • No exploitation in the wild has been reported, but a public crash trigger lowers the bar for attackers.
  • Contrast Java agent 6.38.0 or later can block exploit attempts at the decoding stage.

Your action plan

  1. Inventory JVMs by vendor and exact build string.
  2. Deploy Java agent 6.38.0 or later and enable the Java4Shell rule in block mode.
  3. Patch Oracle JDK now and watch for other vendors' fixed builds.
  4. Hunt for JVM crashes since November 16.

Frequently asked questions

What is Java4Shell? A heap out-of-bounds write in OpenJDK's accelerated Base64 decoder, tracked as CVE-2026-114938.

How can I tell if my applications are vulnerable? You need OpenJDK 17.0.6 or later on the 17, 21, 25 or 27 lines, an x86-64 CPU with AVX-512 VBMI, and untrusted Base64 reaching the decoder.

Can SCA or a WAF protect against it? No. SCA has no dependency to flag, and a WAF cannot see what happens inside the JVM.

Is there a workaround? Disabling the intrinsic with -XX:-UseBASE64Intrinsics is the interim option for hosts you cannot patch or protect, with a possible performance cost.

Robert Vamosi

Robert Vamosi

Sr Product Marketing Manager & CISSP

Enlarged Image