Skip to content
>_KernelBrief
Cybersecurity

Java4Shell (CVE-2026-114938): The OpenJDK Base64 Bug Explained, Who Is Affected and How to Patch

Java4Shell is a critical OpenJDK Base64 decoder bug on AVX-512 x86-64 CPUs. Affected Java versions, fixed builds, the JVM flag workaround and how to check.

By Published 6 min read
// SECURITY
Table of contents

Java4Shell (CVE-2026-114938) is a critical memory-corruption bug in the Java runtime's built-in Base64 decoder. On x86-64 servers with modern AVX-512 CPUs, a short, malformed Base64 string can make the JVM write past the end of a buffer, and researchers have shown it can lead to remote code execution — before login — in widely used products such as Keycloak, Jenkins, Jira and Confluence. Fixed JDK builds were released on November 17, 2026. If you run Java 17, 21, 25 or 27, update your runtime now, or apply the one-line JVM flag workaround below until you can.

What happened

The flaw was disclosed in a coordinated release on November 17, with OpenJDK, Oracle and downstream vendors shipping patched builds the same day. It was reported by the security firm Calif, which named it Java4Shell — a nod to 2021's Log4Shell, since both affect huge numbers of Java applications at once.

Red Hat rates it Critical in its security bulletin, and CISA published an alert urging immediate patching. Scores vary by method: Oracle lists CVSS 3.1 8.1, while Calif rates it CVSS 4.0 9.2.

Calif's timeline also notes that a crash related to the bug was reported publicly to the Adoptium project months earlier, in June, and a fix was proposed but not merged. That detail comes only from Calif's write-up.

The Base64 bug, explained

Java's standard java.util.Base64.Decoder is used almost everywhere: for HTTP Basic authentication headers, JSON Web Tokens, SAML messages, cookies and file uploads. To make it fast, the HotSpot JVM replaces the normal Java code with a hand-optimised machine-code routine (an intrinsic) once the decoder gets "hot" and the C2 just-in-time compiler kicks in.

On x86-64 CPUs that support AVX-512 VBMI, that routine processes 64 bytes at a time. According to Calif's analysis, the code that handles the last few characters miscalculates the remaining output length when the input ends in = padding. The value underflows to a negative number, the write mask becomes "all bytes", and the CPU writes a full 64-byte block into memory that does not belong to the output array.

The trigger is tiny. Both Calif and CIRCL describe a 65-character input — 64 letter As followed by one = — that overwrites 62 bytes past a 50-byte array on Java 21 and later (some Java 17 builds need a longer string). Because so many applications decode Base64 from untrusted requests before checking credentials, an attacker may not need an account at all.

Who is affected

All of the following must be true for a JVM to be exposed:

Condition Detail
Java version OpenJDK-based runtime 17.0.6 or later (17, 21, 25, 27), not yet patched
CPU architecture x86-64 only; Red Hat says ARM64 is not affected
CPU features AVX-512 with VBMI: Intel Ice Lake, Sapphire Rapids, Emerald Rapids, Granite Rapids; AMD Zen 4 and newer
Input The application decodes attacker-supplied Base64 with java.util.Base64

Standard OpenJDK 8 and 11 are not affected, per Red Hat. One exception: Oracle's Java SE 8 Enterprise Performance Pack (8u511b33-perf) is affected and fixed in 8u513-perf.

Because the bug is in the runtime, every vendor build of OpenJDK is in scope: Oracle Java, Eclipse Temurin, Amazon Corretto, Azul Zulu, Microsoft Build of OpenJDK, BellSoft Liberica, SapMachine, Red Hat's build and GraalVM. Most cloud servers bought in the last few years have AVX-512 VBMI CPUs.

Calif says it achieved pre-authentication code execution in default configurations of Keycloak, Atlassian Jira and Confluence, JFrog Artifactory, Jenkins and PingFederate, and post-authentication execution in Apache Kafka, Apache Solr, Elasticsearch, Gerrit and Spinnaker.

Confirmed vs unconfirmed

  • Confirmed: the bug, the affected version range and the fixed builds (Red Hat, Calif, CIRCL), plus CISA's call to patch immediately.
  • Public code: Calif published a small, bounded local reproducer. It is withholding product-specific exploit chains for now.
  • Not confirmed: in-the-wild exploitation. As of November 18, CIRCL and Qualys reported none, and CIRCL cites the Canadian Centre for Cyber Security saying the same. Treat that as a short window, not reassurance — Log4Shell went from disclosure to mass scanning within days.

How to check your systems

1. Find which Java each application actually uses. Bundled runtimes in containers and appliances often differ from the system default.

java -version
readlink -f "$(command -v java)"

# For a running process
jcmd <PID> VM.version

2. Check whether the CPU has the vulnerable feature set (Linux):

grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'

If all four flags print, that host can reach the vulnerable code path.

3. Compare against the fixed builds. Per CIRCL, citing Oracle, the patched upstream versions are:

Java line First fixed version
17 17.0.21.1
21 21.0.13.1
25 25.0.5.1
27 27.0.1.1

Vendor builds use their own numbering — for example, Amazon Corretto's fixes are 17.0.21.1.2, 21.0.13.1.2, 25.0.5.1.2 and 27.0.1.1.4. Check your vendor's advisory for the exact build.

How to fix it

Patch the runtime (the real fix)

Update the JDK or JRE through your vendor or package manager, then restart every Java process — a running JVM keeps using the old code until it restarts. Rebuild container images rather than only updating the host, and ask vendors of Java-based appliances for their patched releases.

Temporary workaround: disable the Base64 intrinsic

If you cannot patch immediately, Red Hat's preferred mitigation is to start the JVM with:

-XX:-UseBASE64Intrinsics

This makes the JVM use the ordinary Java decoder instead of the accelerated assembly routine. Add it to JAVA_OPTS, JAVA_TOOL_OPTIONS or your service's start script, restart, and confirm it took effect:

jcmd <PID> VM.flags -all | grep -F UseBASE64Intrinsics
# expected: bool UseBASE64Intrinsics = false

Expect a small slowdown in Base64-heavy workloads. A broader alternative, -XX:UseAVX=2, disables AVX-512 entirely, but only use it on x86-64 hosts — the JVM will not start on ARM with that flag. Keycloak's maintainers have proposed adding -XX:-UseBASE64Intrinsics to Keycloak's default start scripts.

Red Hat and CIRCL both warn that a WAF or reverse proxy is not a reliable mitigation, because Base64 appears in too many places and formats to filter safely.

Prioritise this week

Patch internet-facing identity and DevOps systems first — Keycloak, PingFederate, Jenkins, Artifactory, Jira and Confluence — then everything else running Java 17+. If you are working through several urgent fixes, this sits alongside the actively exploited LiteLLM flaw CVE-2026-40217 and the Puppet Server flaw CVE-2026-115731 from the same week.

The bottom line

Java4Shell turns one of the most ordinary operations in software — decoding Base64 — into a possible pre-login code-execution path on modern x86 servers. Update every Java 17, 21, 25 and 27 runtime to the November 17 builds and restart. Until then, run with -XX:-UseBASE64Intrinsics.

Frequently asked questions

+Which Java versions are affected by Java4Shell?

OpenJDK-based runtimes from 17.0.6 onward, including Java 21, 25 and 27, until patched. Standard OpenJDK 8 and 11 are not affected, according to Red Hat, although Oracle's Java SE 8 Enterprise Performance Pack is.

+Am I affected if my servers run on ARM or older Intel CPUs?

The bug sits in an x86-64 code path used only on CPUs with AVX-512 VBMI, such as Intel Ice Lake and newer or AMD Zen 4 and newer. Red Hat says ARM64 is not affected. Patch anyway, because workloads can move between hosts.

+What is the quickest workaround if I cannot patch today?

Start the JVM with -XX:-UseBASE64Intrinsics, which makes Java use the ordinary Base64 decoder instead of the vulnerable accelerated path. It requires a restart and may slow Base64-heavy workloads slightly.

+Is Java4Shell being exploited in the wild?

As of November 18, CIRCL and Qualys reported no confirmed in-the-wild exploitation. A small local proof of concept is public, and the discoverers say they have working chains for several products that they are withholding.

Sources & references

  1. Red Hat — RHSB-2026-018: Remote Code Execution via memory corruption on x86-64 systems, OpenJDK (CVE-2026-114938)
  2. Calif — Java4Shell: Write once, RCE everywhere (Nov 17, 2026)
  3. CIRCL — TR-104: Critical Memory Corruption in OpenJDK Base64 Decoder (Nov 18, 2026)
  4. CISA — Critical Java Vulnerability Requires Immediate Patching (Nov 17, 2026)
  5. Qualys — How to Find, Mitigate, and Patch the Critical Java4Shell Flaw (Nov 17, 2026)
  6. Keycloak — Issue #55293: Mitigate OpenJDK Base64 intrinsic vulnerability

Spotted an error? See our Corrections Policy.

  • #java
  • #openjdk
  • #java4shell
  • #cve
  • #vulnerability
  • #jvm
  • #keycloak
KB

KernelBrief Editorial

The KernelBrief editorial desk researches, writes and fact-checks every article published on this site. Every article is checked against primary sources (official documentation, vendor announcements, standards bodies and original research) before publication. Every factual claim is linked to its source, and corrections are handled under our published Corrections Policy.