Original Sigil illustration: a stream of Base64 blocks enters a cracked Java coffee cup and lime memory spills past a hard boundary

Original illustration for Sigil. A small malformed tail. A much larger write.

The short version

Java is supposed to be the safe one. No pointer arithmetic. No manual free(). No buffer overflows. That is the promise.

On November 17, 2026, a 65-byte Base64 string reminded everyone that the promise has an asterisk.

The bug is CVE-2026-114938. The researchers at Calif named it Java4Shell, and a lot of people also call it Java2Shell. It lives in OpenJDK's hardware-accelerated Base64 decoder. A malformed tail can make the decoder write 62 bytes past the end of a 50-byte buffer. That is enough to crash a JVM, leak heap memory, and in some applications reach remote code execution.

Here is the part that matters for most teams:

  • Affected: OpenJDK-based Java 17.0.6 and newer, including 21, 25, and 27, on x86-64 CPUs with AVX-512 VBMI.
  • Not affected: ARM64, and x86-64 chips without those AVX-512 features.
  • Fixed builds: 17.0.21.1, 21.0.13.1, 25.0.5.1, and 27.0.1.1.
  • If you cannot patch today, one JVM flag closes the vulnerable path: -XX:-UseBASE64Intrinsics.
  • Restart the JVM. A package update that is not running is not a fix.

No confirmed in-the-wild exploitation had been reported at the time of writing. That is not a reason to wait. The trigger is short, the technical details are public, and the affected software includes identity providers, build servers, and collaboration tools.

In this piece

What actually broke

Base64 is everywhere. It carries login headers, tokens, file uploads, and API payloads. It is the shipping label of the internet.

Java has a fast path for decoding it. On supported x86-64 chips, the JVM uses AVX-512 instructions to process many bytes at once. The fast path is written in hand-tuned assembly, not Java. That is where the bug lives.

The malformed input is simple:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=

That is 64 A characters and one =. In older OpenJDK 17 builds, the same shape uses 128 A characters.

A normal decoder looks at 65 bytes and allocates a 50-byte output buffer. The fast path handles the first 64 characters. Then it sees the stray = and miscalculates the output length. The length becomes negative, the store mask becomes all ones, and the CPU writes a full 64-byte block starting at offset 48.

In a 50-byte buffer, that means 62 bytes land past the end.

Original Sigil diagram: normal 50-byte output compared with a 64-byte store that writes 62 bytes past the buffer

Original Sigil diagram. The native write happens before Java rejects the input.

A simple way to picture it: a form asks for 50 characters. The clerk writes 64, starting at box 48. The extra characters land on the next form, the one holding something else important.

Java eventually throws IllegalArgumentException. By then, the write has already happened.

The dangerous pattern is boringly common:

String header = request.getHeader("X-Payload");
byte[] decoded = Base64.getDecoder().decode(header);

A try/catch around decode() catches the exception. It does not undo the native write that happened before the exception.

Why a Base64 decoder?

Because performance shortcuts are still code.

OpenJDK's JIT compiler, C2, turns hot methods into native code. For common operations it goes further and uses intrinsics: hand-written routines that map directly to CPU instructions. Base64 decoding is a good candidate. It is hot, regular, and easy to vectorize.

The x86-64 intrinsic processes input in blocks. For a short input it uses VMOVDQU8, a 64-byte vector store, with a mask that says which bytes to write. The mask is calculated from the input length and the padding.

The bug is in that calculation. When the remaining input is only padding, the output length can underflow. The mask is supposed to be narrow. It becomes full width. The store writes 64 bytes instead of the handful that were expected.

The exact instruction sequence is in the Calif write-up. The important part for defenders is simpler:

The vulnerable code runs before the Java-level validation. A try/catch around decode() does not protect the memory before the exception.

Who is exposed

Two gates have to line up.

Gate Affected Not affected
Java runtime OpenJDK-based builds from 17.0.6 onward, including 21, 25, and 27. Oracle Java SE 8u511b33-perf is also listed. Standard OpenJDK 8 and 11 are not listed. Patched builds are not affected.
Processor x86-64 with AVX-512 VBMI: Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids, Granite Rapids; AMD EPYC and Ryzen Zen 4 or newer. ARM64. x86-64 without AVX-512 VBMI.

The runtime list covers the major OpenJDK distributions: Oracle Java SE, Oracle OpenJDK, Oracle GraalVM for JDK, Eclipse Temurin, Amazon Corretto, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine, and Red Hat OpenJDK.

That is why "we use Temurin" or "we use Corretto" is not a get-out-of-jail card. The bug is in OpenJDK code. The vendor decides when the fixed build lands.

There is a third, less comfortable gate: attacker-controlled data has to reach the vulnerable decoder. That is why not every Java app on an affected CPU is instantly exploitable. But authentication headers, cookies, file uploads, and API payloads are exactly the kind of data that reaches Base64 decoders every day.

The apps that made people sit up

Calif demonstrated RCE in default configurations of widely used Java applications.

Before login:

  • Keycloak
  • Atlassian Jira
  • Atlassian Confluence
  • JFrog Artifactory
  • Jenkins
  • PingFederate

After login:

  • Apache Kafka Broker
  • Apache Solr
  • Elasticsearch
  • Gerrit
  • Spinnaker

The list is not exhaustive. Calif also demonstrated RCE in sample applications built on Apache Struts and Spring Boot. The researchers say the product-specific exploit chains are being held back for now.

The pre-auth list is the one to prioritize. An identity provider issues the tokens every other system trusts. A build server signs and ships your software. If either is compromised, the blast radius is not one app.

What an attacker can do

There are three levels of bad.

  1. Crash the JVM. A failed attempt can take the process down. That is a denial of service.
  2. Read heap memory. Calif calls this JavaBleed. The overflow can corrupt a buffer length, turn a writer into a reader, and return memory that may contain keys, tokens, and personal data.
  3. Run code. With enough heap grooming, the write can be extended into a controlled primitive and eventually into code execution.

There is no universal exploit. Each application needs its own chain, and the technique is sensitive to network timing. That slows mass exploitation. It does not protect a specific high-value target.

The exploit does not need a vulnerable application library. The bug is in the runtime. That is what makes it a platform problem, not a dependency problem.

Check your own server

Start with the runtime and the CPU.

java -version

Then check the four CPU flags:

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

All four must print. If the command prints nothing, the CPU does not expose the path this bug needs.

Check the effective JVM flags:

java -XX:+PrintFlagsFinal -version 2>&1 \
  | grep -E 'UseBASE64Intrinsics|UseAVX'

If you run containers, check the runtime inside the container, not only the host. Many images bundle their own JDK. A base image rebuild is required to pick up a patched runtime.

Original Sigil decision flow: two exposure gates and the patch or mitigation options

Original Sigil diagram. Two gates, then a patch. The flags are a stopgap, not a substitute.

The fix

Patch the runtime. That is the only complete fix.

Java line Fixed build
Java 8 Enterprise Performance Pack 8u513-perf
Java 17 17.0.21.1
Java 21 21.0.13.1
Java 25 25.0.5.1
Java 27 27.0.1.1

Other OpenJDK vendors publish their own fixed builds. Check the vendor advisory for the exact build that contains the fix.

If you cannot patch today, use one of these JVM flags:

# Preferred: turn off the fast Base64 intrinsic.
export JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics"

# Alternative: turn off AVX-512. x86-64 only.
export JAVA_TOOL_OPTIONS="-XX:UseAVX=2"

Do not use -XX:UseAVX=2 on ARM. The JVM will fail to start.

Both flags have a performance cost. The first is narrower. The second turns off more than this one bug. Test before you roll it across a fleet.

And restart the process. A flag or a patch that is installed but not running is not protecting anything.

If you cannot patch today

Work in this order:

  1. Identity providers. Keycloak, PingFederate, and anything that issues tokens.
  2. Build and artifact systems. Jenkins, Artifactory, and anything that ships code.
  3. Collaboration systems. Jira and Confluence.
  4. Internet-facing Java services that handle logins, tokens, or uploads.
  5. Internal Java systems. Kafka, Solr, Elasticsearch, Gerrit, Spinnaker.

Reduce exposure while you schedule the patch. Take the console off the open internet or put it behind a VPN. Validate Base64 at the application boundary. Enforce input size limits. Those controls help, but they are not a substitute for the patched runtime.

A strict shape check can remove the known trigger, but it is not a fix:

if (value == null || value.length() > 4096 || value.length() % 4 != 0) {
    throw new IllegalArgumentException("invalid base64");
}

That check is useful defense in depth. It is not a substitute for a patched runtime, because the bug class is bigger than the one trigger shape.

A WAF is a supplement, not a fix. Microsoft published Azure WAF rules for known HTTP patterns. They are useful while you patch. They will not save an application that decodes Base64 in a WebSocket frame, a custom protocol, or a path the rule does not cover.

What this means for AI-built apps

Most vibe-coded apps are JavaScript and TypeScript. They do not run a JVM. Their exposure is different.

But agencies and small teams often run Java somewhere:

  • a self-hosted Jira or Confluence
  • a Jenkins build server
  • an Artifactory cache
  • a Keycloak identity provider
  • a Java backend generated by an AI coding agent
  • a vendor appliance with a bundled JDK

Sigil's blackbox scan can see exposed admin panels and version headers. It cannot see the patch level of a JVM from the outside. This one is a patch-management problem. If you use a managed Java service, ask the vendor for the fixed build. If you run it yourself, check the runtime that is actually running.

The bigger lesson

Java's memory safety promise is real. It is also a promise about the Java code you write, not about every line of assembly that ships inside the runtime.

The bug is a good reminder of something the Calif team calls vibe-uncoding: the most secure feature is often the one you do not need. A Base64 optimization that helps a few high-volume workloads shipped to everyone, including applications that decode a few hundred bytes a day. One unnecessary fast path became a critical vulnerability.

You cannot delete your way out of every bug. But you can ask better questions:

  • Which runtimes are actually running in production?
  • Which of them are bundled inside something else?
  • Which internet-facing consoles do we not need open?
  • Which features are we carrying because they came by default?

Those questions are cheaper than an incident.

References

Sigil publishes defensive explainers. This article does not include a working exploit chain. Patch the runtime, restart the service, and verify the version that is actually running.