“Java4Shell” OpenJDK – Remote Code Execution

Java4Shell is a heap-based buffer overflow in the OpenJDK Base64 decoder that could let an unauthenticated attacker run code in affected Java applications. Oracle and OpenJDK released fixes on November 17, 2026.

Vulnerability

A critical vulnerability known as Java4Shell affects OpenJDK, the open-source implementation of the Java platform. It could let an unauthenticated remote attacker run arbitrary code inside affected Java applications.

The flaw is a heap-based buffer overflow in the hardware-accelerated Base64 decoder in the OpenJDK HotSpot Java Virtual Machine (JVM). On compatible x86-64 processors, OpenJDK uses an optimized decoder built on AVX-512 instructions.

When that decoder processes malformed Base64 input with invalid padding characters, it miscalculates the remaining output length. The wrong length produces an incorrect memory-write mask, so the decoder writes past the end of its output buffer and corrupts adjacent heap memory.

Researchers showed that a relatively small malformed Base64 string can overwrite 62 bytes beyond the expected output boundary. The Java runtime then rejects the input and raises an exception, but by then the memory is already corrupted.

Because the flaw sits in the Java runtime itself, not in one application or framework, many enterprise applications may be exposed. Java applications commonly use Base64 for authentication credentials, access tokens, file uploads and other data. Some may process malicious input before authentication or other security controls apply.

CVE and severity

The vulnerability is tracked as CVE-2026-114938.

Oracle gives it a CVSS 3.1 score of 8.1 (high). Calif, the researchers who found it, give it a CVSS 4.0 score of 9.2 (critical).

Impact

Depending on the application’s memory layout and how far an attacker can manipulate allocations, the flaw may be used for:

  • Denial of service, by corrupting JVM heap memory and crashing the application or disrupting the service.
  • Information disclosure, by manipulating memory structures to expose sensitive data held in memory, such as authentication tokens or credentials.
  • Remote code execution, by exploiting corrupted heap structures to run attacker-controlled code in the context of the affected Java application.

Exploitation isn’t universal. An attacker needs a path that delivers malformed Base64 input to the vulnerable decoder. Reliable code execution also needs application-specific techniques, including manipulation of the JVM heap layout. A vulnerable Java runtime doesn’t automatically make every application on it remotely exploitable.

Exploit status

Calif researchers report unauthenticated remote code execution against default configurations of Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins and PingFederate. Each was deployed with a vulnerable Java runtime on a compatible processor. Apache Kafka, Apache Solr, Elasticsearch, Gerrit and Spinnaker were reportedly exploitable through authenticated functionality.

A public proof of concept showing the underlying memory corruption is available.

As of November 18, 2026, there were no independently confirmed reports of exploitation in the wild.

Affected component and versions

The flaw affects OpenJDK 17.0.6 and later, up to the relevant patched releases, including Java 21, 25 and 27. Oracle lists these affected products and fixed versions:

  • Oracle Java SE 17: 17.0.6 to 17.0.21.0.3, fixed in 17.0.21.1
  • Oracle Java SE 21: versions before 21.0.13.1, fixed in 21.0.13.1
  • Oracle Java SE 25: versions before 25.0.5.1, fixed in 25.0.5.1
  • Oracle Java SE 27: versions before 27.0.1.1, fixed in 27.0.1.1
  • Oracle Java SE 8 Enterprise Performance Pack: 8u511b33-perf and potentially earlier affected builds, fixed in 8u513-perf
  • Oracle GraalVM for JDK 17: versions before 17.0.21.0.3, fixed in 17.0.21.1
  • Oracle GraalVM for JDK 21: versions before 21.0.13.0.3, fixed in 21.0.13.1
  • Oracle GraalVM Enterprise Edition: versions before 21.3.20.0.3, fixed in 21.3.20.1

Other OpenJDK-based distributions are also affected, including Amazon Corretto, Eclipse Temurin, Azul Zulu, Microsoft Build of OpenJDK, Red Hat OpenJDK, BellSoft Liberica and SAP SapMachine. They may use different version numbers and release schedules, so check each vendor’s guidance.

Standard OpenJDK 8 and OpenJDK 11 releases aren’t affected by this vulnerability. Oracle’s November 2026 update fixes other vulnerabilities in those release lines.

Exploitation needs an x86-64 processor that supports AVX-512 Vector Byte Manipulation Instructions (VBMI). That includes certain Intel Xeon processors from the Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids families. It also includes AMD processors based on Zen 4 or newer. ARM64 systems, and x86-64 systems without the required instructions, aren’t affected.

Fix and mitigation

Oracle and the OpenJDK project released security updates on November 17, 2026. Upgrade affected Java runtimes to the latest patched releases from each vendor.

  • For Oracle Java SE, the November 2026 Critical Security Patch Update provides 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Upgrade Oracle Java SE 8 Enterprise Performance Pack to 8u513-perf or later.
  • Identify Java runtimes across the environment, including standalone installs, runtimes embedded in third-party enterprise applications and runtimes in container images. Start with internet-facing services and applications that process untrusted authentication data, tokens or file uploads.
  • Where a commercial application bundles its own Java runtime, check with the software vendor and apply its product update when one is available. Updating an application’s framework or dependencies may not fix the issue if the JVM underneath remains vulnerable.
  • After patching, restart affected services so they load the patched runtime. Rebuild and redeploy container images, and verify the version each running Java process uses.

Where you can’t patch right away, disable the affected hardware-accelerated Base64 decoding. The preferred workaround is to start the JVM with -XX:-UseBASE64Intrinsics. It turns off the JVM’s optimized Base64 encoding and decoding routines, so the vulnerable code path can’t run. It’s the narrower option, and it limits any performance impact to Base64 processing.

The alternative is to restrict affected x86-64 JVMs to AVX2 with -XX:UseAVX=2, which stops the vulnerable AVX-512 decoder from being selected. It may slow other JVM operations that benefit from AVX-512. Apply it only to compatible x86-64 JVMs, because ARM64 implementations may reject the option and fail to start.

Both workarounds need the JVM process restarted. Test them for application compatibility and performance before production. Where supported, check the effective JVM options with jcmd <PID> VM.flags -all.

To spot potentially affected Linux systems, check the Java version with java -version. Then check the processor’s instruction flags with grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'. All four flags, avx512f, avx512bw, avx512vbmi and bmi2, must be present for the affected decoding path to be used.

These checks only identify potentially affected configurations. They don’t show that a particular application is exploitable. Run the version check against the runtime each application actually uses, not just the system’s default Java install.

References