Jorge Turbica / blog · Blog ← All articles ES · Leer en español
Languages

Java4Shell: 65 Base64 characters give pre-auth RCE in OpenJDK on Jira and Keycloak

A bug in OpenJDK 17.0.6+ accelerated Base64 decoding allows remote code execution on AVX-512 CPUs. Fixed versions and how to mitigate.

Sixty-four letter "A"s followed by a single "=" are enough to write 62 bytes past the end of an array inside the JVM. That is Java4Shell (CVE-2026-114938), a memory-corruption bug in OpenJDK's Base64 decoder that Calif.io disclosed on 17 November 2026, the same day OpenJDK and Oracle shipped the fix. The researchers turned it into unauthenticated remote code execution in Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate, all in their default configurations.

What breaks

Java is memory-safe; parts of the JVM are not. To decode Base64 faster, HotSpot's C2 compiler swaps the method for a hand-written assembly intrinsic that uses AVX-512 VBMI instructions. That code gets the store mask wrong when the tail of the input is pure padding (=, X=, XY=…): the output length underflows to -1 or -2 and the mask ends up with all 64 bits set.

With the 65-character input, Java allocates a 50-byte array and the intrinsic writes 64 bytes. Java eventually throws IllegalArgumentException because the input is invalid, but by then neighbouring heap objects are already corrupted. From there Calif chains a Heartbleed-style memory leak into code execution.

What makes it serious is not the decoder but where it sits: authentication headers, file uploads, tokens, network messages. Calif also showed post-auth RCE in Kafka, Solr, Elasticsearch, Gerrit and Spinnaker, plus a client-side exploit: a Java program that opens a TLS connection to a malicious server can be compromised even if it listens on no port at all.

The part the industry should note: according to Calif, Codex found the bug in an hour of its researcher's time and the first working exploit took two more hours, for under $200 in tokens.

Who is affected

Both conditions must hold:

  • An affected JVM: OpenJDK 17.0.6 and later on the 17, 21, 25 and 27 lines, and every distribution built from it (Temurin, Corretto, Zulu, Microsoft Build of OpenJDK, Red Hat, SapMachine, Liberica, GraalVM for JDK…). Standard 8 and 11 do not ship this code; Java SE 8 Enterprise Performance Pack (8u511b33-perf) does.
  • An x86-64 CPU with AVX-512 VBMI: Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids, and AMD EPYC and Ryzen from Zen 4 onwards. ARM64 is not affected, so Graviton or Ampere nodes are out of scope.

The score depends on who computes it: 9.2 out of 10 under CVSS 4.0 according to Calif, and 8.1 under CVSS 3.1 in the OpenJDK advisory, where it is the most severe of the release's ten CVEs.

Fixed versions

LineOracle Java SEAmazon Corretto
1717.0.21.117.0.21.1.2
2121.0.13.121.0.13.1.2
2525.0.5.125.0.5.1.2
2727.0.1.127.0.1.1.4
8 Performance Pack8u513-perf—

As of 18 November 2026 there were no confirmed fixed build numbers for Temurin, Zulu, Red Hat, Microsoft or Linux distribution packages; each vendor publishes its own, possibly with different numbering. That includes container base images and the JDKs bundled inside products such as Jira or Keycloak, which get updated with the product, not with your OS.

How to tell if you are exposed

Start with the CPU. On Linux, the command Calif publishes must print all four flags for the machine to meet the hardware condition:

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

Then check the version of every JVM that actually runs, not the host's: java -version inside each image and in each product's bundled JDK. Calif also publishes a self-contained Java program that warms up the decoder and checks whether the 62 bytes after the array get overwritten; every write lands inside an array it owns, so it is safe to run against a specific build.

How to mitigate until the patch lands

If your distribution has no fixed build yet, OpenJDK lets you switch the intrinsic off at JVM startup:

bash
# Disable the accelerated Base64 decoder (x86-64 hosts only)
export JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics"

The alternative, -XX:UseAVX=2, turns off AVX-512 entirely and costs more performance. The caveat that really matters: do not bake either flag into a multi-arch image. On ARM the JVM does not recognise the option and refuses to start, so a cluster-wide JAVA_TOOL_OPTIONS would take down exactly the nodes that were never at risk. On mixed fleets, apply it only to workloads scheduled on x86-64 (for example with a nodeSelector on kubernetes.io/arch).

Neither flag replaces the patch, and both need a JVM restart.

Checklist before closing the incident

  • Inventory every JVM by line, vendor and architecture, including those bundled in third-party products.
  • Patch internet-facing services with authentication or file uploads first: Keycloak, Jira, Confluence, Jenkins, Artifactory.
  • Rebuild images on the fixed base and check java -version in the deployed container, not in the Dockerfile.
  • If you use the mitigation flag, benchmark Base64-heavy workloads first and remove it once the patch is in.
  • Watch for unexpected JVM restarts and Java processes spawning shells or opening new outbound connections.

Calif is holding back the product-specific exploits for now. That is the window to patch before they go public.

Sources

Jorge Turbica

Software Engineer and SRE. I write about the real challenges I run into in production.

See portfolio ↗