Security

How to Patch Java4Shell (CVE-2026-114938) on OpenJDK 17, 21, 25 and 27

Oracle shipped fixes for the OpenJDK Base64 flaw on November 17. Here is how to find exposed hosts, patch them and use the interim flag.

Tyler Brennan

Runtime & Language Tooling Writer

Published 7 min read
Computer hardware with a network switch and circuit board, representing a server that runs Java workloads
On this page 8 sections

Java4Shell (CVE-2026-114938) is a memory corruption bug in OpenJDK's Base64 decoder, fixed on November 17, 2026. To patch it, move to your vendor's November build, such as Oracle's 17.0.21.1, 21.0.13.1, 25.0.5.1 or 27.0.1.1. Until then, start the JVM with -XX:-UseBASE64Intrinsics. Only x86-64 hosts with AVX-512 VBMI can reach the bug.

Backtrace tests developer tools against real codebases, and a runtime flaw like this one is where upgrade guides usually go vague. This guide is for engineers who run Java services, or Java-based tools such as Jenkins, Jira and Keycloak, and need to know which hosts to patch first. It covers exposure, discovery commands, fixed builds, the interim flag and verification, as of November 18, 2026.

Calif, the firm that found the flaw, also disclosed PHP2Shell recently. If you handled that one, our PHP2Shell patch guide shows the same triage habit: find the reachable hosts before you touch the rest.

What Is Java4Shell and Why Does a Base64 Bug Matter?

Java4Shell is a memory corruption flaw in the optimized code OpenJDK uses to decode Base64 on certain Intel and AMD processors. A crafted string makes the decoder write past its buffer. Attackers can then read memory or, with per-application work, run code on the server.

Base64 sits in more code paths than most teams expect. Authentication headers, JWT handling and file uploads all decode it. That is why a bug in one helper reaches so many products.

The score depends on who you ask. Oracle assigned a CVSS 3.1 score of 8.1 and rates attack complexity as high. Calif scores the flaw 9.2 under CVSS 4.0. In its Java4Shell write-up, Calif says the corruption can be triggered by 64 "A" characters followed by an equals sign, or 128 on older OpenJDK 17 builds.

Oracle adds a condition. The flaw is only exploitable when an application passes untrusted data to the affected Java APIs. A web service that decodes a request header meets that condition.

Which Hosts Are Exposed to CVE-2026-114938?

A host is exposed when it runs an affected OpenJDK line on an x86-64 processor with AVX-512 VBMI support. The vulnerable code is a speed shortcut that only those chips use. Everything else decodes Base64 through a different path and is not affected.

Green processor circuit board, illustrating the CPU features that decide whether a host is exposed

Calif lists the CPU families that qualify. They include Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids, plus AMD processors based on Zen 4 or newer. ARM64 systems are not affected. That detail changes your fleet math, because a mixed cluster may have only half its nodes in scope.

Version matters too. The OpenJDK Vulnerability Group lists the 17, 21, 25 and 27 lines. Standard Java 8 and Java 11 are not on the advisory. The one Java 8 exception is Oracle's Enterprise Performance Pack build, 8u511b33-perf.

In Kubernetes, the CPU belongs to the node, not the pod. The same Deployment can land on an AVX-512 node on Monday and an ARM node on Tuesday. Check your node pools, and patch the images before you change any scheduling rules.

Check each host with one command. On Linux, the processor must report all four of these flags:

text
grep -o -w -E 'avx512f|avx512bw|avx512vbmi|bmi2' /proc/cpuinfo | sort -u

If the output lists all four, the host can run the vulnerable path. If any flag is missing, the intrinsic stays off. Run it on the node, not inside a container image build, because the CPU of the build machine tells you nothing about where the container will run.

How Do You Find Every JVM That Can Reach the Bug?

List every running JVM, record its exact build string, and cross-reference it with the CPU flags above. Start with the processes, then move to images and package manifests. A JVM you cannot name is a JVM you cannot patch.

Laptop screen showing source code in a dark room, used here for the discovery commands in this section

On a host, find running Java processes and their runtime paths:

text
ps -eo pid,args | grep '[j]ava' | awk '{print $1, $2}'
readlink -f /proc/<pid>/exe
<that-path> -version

The first failure most teams hit is a bundled runtime. Jenkins, Elasticsearch and Kafka often ship their own JDK, so the system java -version says nothing about them. Check the runtime each service launches. Then scan container images for the same build strings, since a base image pinned months ago keeps its old JDK.

If you already keep software bills of materials, query them for the JDK component and its version. Our SBOM generation guide explains how to produce those records without slowing releases. A good SBOM turns this inventory step from a day of grepping into a single query.

Build a short table as you go. Record the host, the service, the JDK build, whether the CPU flags are present, and whether the service is reachable from outside. That table becomes your patch order.

Which Java Apps Should You Patch First?

Patch anything that decodes untrusted input on a network edge before anything internal. Calif reports pre-login code execution in default configurations of Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins and PingFederate. Those six come first.

Network switch with cables, representing internet-facing services that decode untrusted input

Calif also reports code execution after login in Apache Kafka brokers, Apache Solr, Elasticsearch, Gerrit and Spinnaker. Those matter next, because an attacker with a stolen low-privilege account can reach them. A client-side path exists as well. A Java program that opens a TLS connection to a server an attacker controls can be compromised even if it exposes no service of its own.

The right order is exposure first, then blast radius. A build server holds deploy keys, so it ranks above a read-only dashboard. Our Patch Tuesday triage guide walks through that ranking method for a month with far more fixes than this one. For a critical patch on a self-hosted tool, the GitLab CVSS 10 upgrade guide shows the maintenance-window steps.

What Are the Fixed Builds for Each Java Release?

Oracle released fixed builds on November 17, 2026. Each one adds a single trailing patch number to the affected build. Vendors that rebuild OpenJDK, such as Amazon Corretto, Eclipse Temurin, Microsoft, Azul Zulu, BellSoft Liberica, SAP SapMachine and Red Hat, ship their own fixed versions on their own timelines.

What Are the Fixed Builds for Each Java Release?
Java lineAffected Oracle buildFixed Oracle build
Java 8 Enterprise Performance Pack8u511b33-perf8u513-perf
Java 1717.0.21.0.317.0.21.1
Java 2121.0.13.0.321.0.13.1
Java 2525.0.5.0.325.0.5.1
Java 2727.0.1.0.327.0.1.1

The table follows Tenable's Java4Shell FAQ, which also notes that Oracle lists only builds it supports and says earlier ones are likely affected too. Treat any older build as vulnerable.

If you run Java 27 and have not moved yet, pair this fix with the changes in our JDK 27 upgrade guide, since the G1 default and object header changes deserve their own test pass. If your services run in containers, rebuild images from a patched base and follow the test order in our Docker Engine 29.9.1 upgrade guide.

Can You Mitigate Java4Shell Before You Patch?

Yes. Calif identifies two JVM startup options that keep the vulnerable code from running. Use -XX:-UseBASE64Intrinsics first, because it turns off only the Base64 shortcut. The alternative, -XX:UseAVX=2, disables AVX-512 instructions across the whole JVM.

Rusty gate secured with three padlocks, representing a temporary mitigation applied before patching

Neither flag appears in Oracle's or the OpenJDK Vulnerability Group's advisory, so treat them as a stopgap from the researchers, not vendor guidance. The second option also has a trap. It applies only to x86-64, and Java on ARM processors fails to start when you pass it. That is the failure you will see first in a mixed fleet.

Do not leave the flag in place for good. It is a bandage, and a future engineer will not know why it is there. Add a ticket to remove it once every service runs a fixed build.

Set the flag without editing every launch script by using the standard environment variable:

text
export JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics"
java -XX:+PrintFlagsFinal -version | grep UseBASE64Intrinsics

The second line should print the flag as false. Remember that a restart is required, because JVM flags are read at startup. Turning off an optimization can cost some Base64 throughput, so watch latency on services that decode large payloads.

How Do You Verify the Fix and Watch for Exploitation?

Confirm the running build string after each restart, then re-run your discovery table. A patched file on disk does not help if the old process is still running. Compare each service's reported version with the fixed build for its line.

As of November 17, Tenable was not aware of any reported exploitation, and the flaw was not in the Cybersecurity and Infrastructure Security Agency (CISA) Known Exploited Vulnerabilities catalog. Calif has published a proof of concept that triggers the bug without taking control of the system. A second researcher reports a working exploit that must be adapted per application. Calif says it will publish product-specific exploits later, so the quiet period is short.

Watch for JVM crashes, since Calif says a failed attempt can crash the application. Repeated restarts on a Jenkins or Keycloak node after November 17 deserve a look at the request logs for long Base64 strings.

Conclusion: What to Do Today

Run the CPU flag check, build the JVM inventory, and patch the six pre-login products first. Apply -XX:-UseBASE64Intrinsics where a restart is cheap and patching must wait. Backtrace's editors compared the fixed builds above with the Tenable and Calif material on November 18, so check your distribution's own advisory before you assume a patch exists.

Is my Java application affected by Java4Shell?
It is affected if it runs an OpenJDK 17, 21, 25 or 27 build from before the November 17 fixes, on an x86-64 processor with AVX-512 VBMI, and passes untrusted data to the Base64 decoder. ARM64 hosts are not affected. Check the CPU flags first, then the exact JDK build string of every running service.
Does Java4Shell affect Amazon Corretto and Eclipse Temurin?
Yes, according to Calif, because the flaw sits in OpenJDK code that those distributions build from. Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine and Red Hat OpenJDK are all listed. Each vendor ships fixed builds on its own schedule, so check its advisory.
Can I mitigate Java4Shell without restarting my servers?
No. JVM flags are read at startup, so both -XX:-UseBASE64Intrinsics and -XX:UseAVX=2 need a restart to take effect, and so does patching. Plan one restart window that applies the fixed build, and use the flag only on hosts that must wait for their vendor's release, then remove it once the patch lands.
Is Java4Shell being exploited in the wild?
As of November 17, Tenable knew of no reported exploitation, and the flaw was not in CISA's Known Exploited Vulnerabilities catalog. Calif has published a proof of concept that triggers the bug, and another researcher reports a working application-specific exploit. Treat the window as short and patch exposed hosts first.

Written by

Tyler Brennan

Runtime & Language Tooling Writer

11+ years experience

Tyler spent nine years as a full-stack engineer at a mid-sized e-commerce company, where he owned the Node.js services and the build pipeline behind them. He ran four major runtime upgrades there and still keeps the habit of reading changelogs for what gets removed before what gets added. At Backtrace he covers language releases, package managers and the local tooling that decides how fast a team moves. His rule is simple: an upgrade guide is only useful if it lists the failure you will see first and the command that finds it.

Credentials

  • B.S., Computer Science, University of Wisconsin-Madison
  • Former Senior Full-Stack Engineer, e-commerce platform (2014-2023)
  • OpenJS Foundation Node.js Application Developer certification