Illustration of encoded data streams passing through a server processor, with one stream disrupted

Technology & security ยท

Java4Shell: How the Java Vulnerability Works and How to Fix It

On 17 November 2026, a vulnerability in the Java runtime was disclosed under the name Java4Shell and the identifier CVE-2026-114938. It affects an optimised Base64 decoder in certain Java builds. Under the right conditions, malformed data can corrupt a running applicationโ€™s memory. That may crash the application or, with a carefully constructed attack against a suitable product, allow an attacker to access information or execute code without first signing in.

This is not the 2022 Spring4Shell vulnerability, nor is it a flaw in every program written in Java. The distinction matters: Java4Shell is in the runtime underneath applications, so updating a web application alone may leave its Java process vulnerable. Conversely, the presence of Java on a server does not, by itself, prove that an attacker can exploit this flaw. Exposure depends on the runtime build, processor, active optimisation and a route by which attacker-controlled Base64 reaches the decoder.

What went wrong?

Base64 turns binary information into text characters that can travel through systems designed to handle text. It commonly appears in authentication data, tokens, uploaded material and network protocols. When an application asks Java to decode Base64, Java may use a fast path written for particular x86-64 processor instructions. The problematic path uses AVX-512 VBMI instructions to process several bytes at once.

The bug is in the handling of malformed input near the end of the encoded value. The decoder calculates the size of an output array, but the optimised routine can then write beyond that arrayโ€™s boundary. The application may eventually reject the malformed value as invalid; the rejection comes too late to undo the memory corruption. Java ordinarily protects applications from this class of mistake, but the fast path is low-level runtime code rather than ordinary bounds-checked Java code.

A crash is one possible consequence. A more serious outcome requires an attacker to shape what lies next to the affected array in memory and turn a limited overwrite into a useful chain. The discovering researchers say they demonstrated information disclosure and remote code execution in several products. These are product-specific chains, not one universal command that compromises every Java server. Oracle gives CVE-2026-114938 a CVSS 3.1 base score of 8.1, while the researchers score it 9.2 under CVSS 4.0; those scores use different versions of the scoring system.

How could it be exploited?

An attacker needs a way to supply Base64 data that an affected Java process will decode. A public-facing login service is one example: it may decode a value in an authentication request before it knows who sent the request. Other applications decode values in API requests, file submissions or messages from connected systems. If that path reaches the vulnerable fast decoder, deliberately malformed input can trigger the overwrite. Depending on the application and memory layout, the immediate result might be a crash, a disclosure of data held in process memory or, in a stronger chain, code execution with the Java serviceโ€™s privileges.

Calif, the researcher that disclosed the issue, reports pre-authentication exploit demonstrations against Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate, among others. The Keycloak and Jenkins projects have separately published guidance confirming that their deployments can be exposed when they run on an affected Java runtime and processor. A service behind a login page is therefore not necessarily protected: the vulnerable decoding may occur while processing the login itself. For applications where the relevant route requires an existing account, the risk remains serious but the attack begins from a different position.

Do not treat the researcherโ€™s product list as a complete inventory or assume every installation of a named product is exploitable. A product can ship its own Java runtime, use a system installation or run inside a container. Processor features can differ between production nodes, cloud virtual machines and failover hosts. A reverse proxy or web application firewall may reduce exposure to some request patterns, but it is not a reliable substitute for updating the affected runtime.

Which systems need attention?

The principal affected OpenJDK lines are 17 from 17.0.6 onward, 21, 25 and 27 up to their respective corrected releases. The flaw requires an x86-64 processor exposing AVX-512 VBMI and the affected Base64 intrinsic to be active. ARM64 systems and x86-64 processors without that feature are not known to be affected by this particular code path. This does not make old Java builds generally safe: they may have other security defects. Oracle also lists a specific Java 8 performance build, 8u511b33-perf, among its affected products; that does not mean all ordinary Java 8 or Java 11 builds contain Java4Shell.

Inventory each running Java service, including scheduled tasks, standby systems, appliances and containers. On the system that actually runs the application, java -version identifies the Java executable selected in that shell. A service manager may select a different one, so inspect its startup configuration or query the running process as well. In a container, check the runtime inside the image, not merely the Java installation on its host. On Linux, checking avx512vbmi in /proc/cpuinfo helps identify whether the processor feature is exposed to that host or virtual machine. Confirm the remaining conditions against the Java supplierโ€™s advisory; a version string alone is not a complete exposure test.

Install the permanent fix

First, identify the Java supplier and exact build used by each application. An operating-system package, Oracle installation, Eclipse Temurin archive and application-bundled runtime each have a different update route. Record the Java path, vendor, version, host or container image, and application owner before changing anything. Prioritise internet-facing identity, administration and collaboration services, then systems accessible from less-trusted internal networks.

Second, obtain a vendor-confirmed corrected build. Oracleโ€™s November 2026 Java release lines include 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Eclipse Temurin names fixed builds 17.0.21.1+2, 21.0.13.1+2, 25.0.5.1+2 and 27.0.1.1+4. Other suppliers may use different build numbers or backport the fix while keeping an older-looking version string. Use the advisory for the distribution you actually run; do not install an unrelated supplierโ€™s binary simply because its number is higher. Oracleโ€™s wider November update also covers other vulnerabilities, and its Java 8 and 11 releases should be considered under their own advisories rather than described wholesale as Java4Shell fixes.

Third, install through the normal update channel. For a distribution-managed JDK, refresh package metadata and upgrade the installed Java package using that distributionโ€™s package manager after its security advisory confirms a fixed package is available. As an example, for a Java 17 runtime managed by Debian or Ubuntu packages, run sudo apt update and then sudo apt install --only-upgrade openjdk-17-jre-headless; also upgrade openjdk-17-jdk if that is installed. For a RHEL-family Java 17 installation, an equivalent example is sudo dnf upgrade 'java-17-openjdk*'. Substitute the package and release stream your service actually uses. Check the complete package release, not just the upstream version: suppliers often backport fixes. If Java came from an archive or installer, use the supplierโ€™s instructions to install its corrected build and update the serviceโ€™s configured Java path.

Fourth, rebuild anything that bundles the runtime. Updating the host does not replace Java inside a container image or commercial product. Pull a product image whose vendor confirms the fix, or rebuild a custom image from a corrected Java base image, then redeploy it. For products such as Keycloak or Jenkins, follow their product-specific guidance as well as the runtime advisory. Include test, standby and autoscaling images; otherwise a later rollout can silently reintroduce the vulnerable build.

Finally, restart and verify every instance. A newly installed JDK does not change code already loaded by a running Java process. Restart the application or roll its pods and containers, then verify the version reported by the runtime that is actually serving traffic. Test login, uploads, API calls and other critical workflows. Confirm every backend, not only the one reached by a public health check. Keep a record of the corrected package or image digest and the time each running instance was verified.

If you cannot patch immediately

Temporarily start each affected Java process with -XX:-UseBASE64Intrinsics. This disables the accelerated Base64 path containing the flaw. Add it to the applicationโ€™s existing JVM startup options rather than replacing those options, and restart the process. A flag typed into an administratorโ€™s interactive shell will not change a service that is already running or one started by systemd, Docker or Kubernetes. The setting must be applied in the configuration that launches that service and on every replica.

The alternative -XX:UseAVX=2 prevents the JVM from using AVX-512 paths more broadly. It may affect performance and should be used only where the runtime and processor support it. Prefer the narrower Base64 flag where the application supplier recommends it. After restart, inspect the live JVMโ€™s flags with jcmd <PID> VM.flags -all and confirm UseBASE64Intrinsics = false. If jcmd is unavailable in a minimal runtime image, confirm the effective startup arguments through the service or productโ€™s supported diagnostics. Treat either flag as an interim mitigation, not as a reason to postpone a corrected runtime indefinitely.

Check for signs of compromise

Review the period during which affected services accepted untrusted input. Repeated Java crashes, unexplained restarts, unusual child processes, unexpected outbound connections or changes to application files merit investigation. None proves Java4Shell exploitation on its own, and an absence of such signs does not prove that exploitation did not occur. Preserve relevant application, proxy and host logs before making destructive changes. If investigation finds evidence of intrusion, isolate affected systems, determine what the Java service account could access, recover from trusted images and rotate credentials that may have been exposed. Patching closes the entry point; it cannot undo an earlier compromise.

The immediate priorities are straightforward: identify the runtime each Java application truly uses, install a fix confirmed by that runtimeโ€™s supplier, restart all affected processes and verify the live deployments. Where a patch is not yet available, disable the vulnerable Base64 intrinsic while arranging the permanent update.

Sources