RSS
News

Java4Shell: how to check if your JVM is affected by the OpenJDK Base64 bug Codex found

Java4Shell, disclosed by Calif on November 17, 2026, is a HotSpot Base64 bug that can lead to remote code execution on OpenJDK 17.0.6+ running on x86-64 CPUs with AVX-512 VBMI. Check your JDK, CPU and JVM flags, and see how Codex found it.

Silver spoon on black round plate illustrating Java4Shell, how to check if your JVM is affected
Photo by HelpDesk Heroes on Unsplash

Java4Shell is a memory-corruption bug in OpenJDK's HotSpot JVM that security firm Calif disclosed on November 17, 2026, published alongside the OpenJDK security advisory and Oracle patch released that day. A malformed Base64 string, decoded by the JIT-compiled x86-64 fast path, writes past the end of its output buffer. Calif's researcher Quang Luong turned that into a heap leak and remote code execution against real applications, and says the bug was found by pointing Codex at the JVM.

Whether your Java services are exposed comes down to three things: the JDK version, the CPU it runs on, and whether you can patch or add a JVM flag today. This guide walks through each, then looks at how the bug was found.

Quick facts

  • Component: OpenJDK HotSpot, x86-64 Base64 intrinsic used by the C2 JIT compiler (java.util.Base64 decoding).
  • Affected, per Calif: OpenJDK 17.0.6 and newer, plus builds made from it: Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine, Red Hat OpenJDK, Oracle OpenJDK, Oracle Java SE and Oracle GraalVM for JDK.
  • Oracle's list of vulnerable Oracle Java SE versions, quoted by Calif: 8u511b33-perf, 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3 and 27.0.1.0.3.
  • Hardware: only x86-64 CPUs with AVX-512 VBMI. ARM64 is not affected. Calif names Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids, and AMD EPYC and Ryzen Zen 4 or newer.
  • Fix: the OpenJDK security advisory of November 17, 2026 and Oracle's November 2026 security patch.
  • Workaround: start the JVM with -XX:-UseBASE64Intrinsics, or -XX:UseAVX=2 on x86-64 only.
  • CVE: Calif's write-up does not give one, and the OpenJDK advisory does not say which of its ten CVEs is Java4Shell, so we do not map it here.

Step 1: check your JDK version

The OpenJDK advisory says the affected versions are 27.0.1.0.3, 25.0.5.0.3, 21.0.13.0.3, 17.0.21.0.3, 11.0.33, 8u512 and earlier, and recommends upgrading as soon as possible. That covers all ten CVEs in this release. For Java4Shell itself, Calif puts the start at 17.0.6, so a JDK 11 server is not exposed to this bug but still needs the other fixes. If you use a vendor build such as Temurin or Corretto, install that vendor's November update.

Step 2: check the CPU

Because the broken code is an AVX-512 path, a server whose CPU lacks AVX-512 VBMI never runs it. On Linux, Calif gives this check; the output must include all four flags for the machine to be vulnerable:

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

This matters for cloud fleets. The same container image can be safe on an ARM64 instance and exposed on a recent Intel Xeon or AMD Zen 4 instance, so check the instance types you actually run, not just the image.

Step 3: patch, or add a flag

Upgrading is the real fix. If a JDK upgrade has to wait for testing, Calif lists two JVM options that switch off the vulnerable path:

  • -XX:-UseBASE64Intrinsics disables the hardware-accelerated Base64 encode and decode routines.
  • -XX:UseAVX=2 disables AVX-512 entirely. Use it only on x86-64 hosts: Calif warns that OpenJDK on ARM does not recognise it and will fail to start.

The first flag is narrower. The second disables AVX-512 across the JVM, which may cost performance elsewhere, though Calif does not quantify either.

How the bug works

For short inputs the x86-64 intrinsic decodes with a masked vector store, where a 64-bit mask decides which output bytes get written. The mask comes from the output length, which is reduced by one for each padding character. For tails such as '=', 'X==' or 'XY=' the output length is zero before padding, so the subtraction underflows to -1 or -2, and the mask becomes all ones. All 64 bytes are written. With 64 'A' characters followed by '=', Java allocates a 50-byte buffer, and the store writes 64 bytes starting at offset 48. On JDK 17 the trigger is 128 'A's plus '=' because the length threshold is higher. The decoder still throws IllegalArgumentException, but the memory has already been overwritten.

Only the position of the write is controllable; most of the bytes are fixed. Calif used a classic browser-exploit move: overwrite the length of a neighbouring array so it becomes a writer, use that to enlarge a second array whose contents are echoed back in a response, and read the heap. Calif calls that stage JavaBleed, since the heap can hold personal data, private keys and tokens. From there the chain reaches the JIT code cache for code execution. Calif published a self-contained, bounded proof of concept that prints REPRODUCED on affected JDKs, and is holding back the product-specific exploits until people have had time to upgrade.

Limits Calif admits

  • There is no universal payload. Each target needs its own profile: a route that decodes attacker Base64, a writer, a reader that echoes data back, a heap layout and an application action.
  • The remote heap grooming is sensitive to network latency and jitter; Calif rented a VM in the same cloud region as its target.
  • Some grooming profiles need partial request bodies. nginx buffers request bodies by default, which removes that timing, but Calif says this is not a general mitigation: its Elasticsearch chain works from one complete request, and WebSocket traffic after an upgrade is not buffered.

How Codex found it

Luong says he told Codex to audit the JIT compiler, intrinsics, widely used APIs and cryptography the way a serious security researcher would in 2026. Most early findings were what he calls slop: unreachable code, or exploitation requirements that were not realistic. He kept prompting until Codex flagged memory corruption in the Base64 decoder. Building the exploit still took human expertise: the AI got stuck on heap grooming, so Calif wrote a small heap tracer and visualiser to show the agent the heap state.

Java4Shell lands in the same week as two HTTP/2 remote code execution bugs in nginx, which Wiz Research and four other teams (Ikotas Labs, Metnir, Rapid7 and Xint) found independently. Wiz cites Java4Shell in its own write-up as part of the same trend: memory-safety bugs that used to be protected by sheer complexity are now within reach of AI-assisted research, for defenders and attackers alike.

Try it with your AI. Give this to a coding agent with read access to your deployment configs to inventory Java4Shell exposure. It only reads and reports until you approve changes.

Help me find Java services exposed to Java4Shell, the OpenJDK HotSpot x86-64 Base64
intrinsic bug disclosed by Calif on November 17, 2026. Read only; do not edit anything
until I confirm.
1. In [repository or config directory], list every place a JDK or JRE version is set:
   Dockerfiles (FROM lines), build files, CI configs, Helm charts or deployment
   manifests. Report vendor (Temurin, Corretto, Zulu, etc.) and version.
2. Mark each as affected if it is OpenJDK 17.0.6 or newer and older than the November
   17, 2026 security update for its line. Also flag Oracle Java SE 8u511b33-perf, which
   Oracle lists as vulnerable.
3. For each service, list the CPU architecture it is deployed on if the manifests say so
   (x86-64 or ARM64). Only x86-64 CPUs with AVX-512 VBMI are affected.
4. For affected x86-64 services, propose either the vendor's November 2026 JDK update or
   adding -XX:-UseBASE64Intrinsics to the JVM options as a stopgap. Show me the diff and
   wait for my confirmation.
Do not use -XX:UseAVX=2 on any ARM64 service: the JVM will not start. Do not read
secrets or credential files.

FAQ

How can I test whether my JDK is vulnerable to Java4Shell? Calif's standalone Base64Trigger warms up the decoder, then decodes 64 'A' characters plus '=' into a 4096-byte array; it prints REPRODUCED if bytes past the output were overwritten.

Is Java 8 or Java 11 affected by Java4Shell? Calif says the bug affects OpenJDK 17.0.6 and newer, but Oracle's list of vulnerable Oracle Java SE versions includes 8u511b33-perf. Java 8 and 11 users should still install the November 2026 updates, which fix other CVEs in those lines.

Are Apple Silicon Macs or AWS Graviton servers affected? No. The vulnerable code only runs on x86-64 CPUs with AVX-512 VBMI; Calif says ARM64 CPUs are not affected.

What is the Java4Shell CVE number? Calif's write-up does not list one, and OpenJDK's November 17 advisory does not label which CVE it is. We will update this post if either publishes the mapping.

Is there a public exploit? Calif published a bounded trigger that only writes inside a test array, not an attack. Its application-specific exploit chains remain private for now.

Source: Calif: Java4Shell, The Tail of Base64, OpenJDK Vulnerability Advisory: 2026/11/17, Wiz Research: Unauthenticated remote code execution in NGINX

This story first appeared in the claudefox daily briefing for November 19, 2026.