Java4Shell (CVE-2026-114938): pre-auth memory corruption in OpenJDK

8 min read Original article ↗

Last updated Nov. 19, 2026, 15:15 CET. Temurin 17.0.21.1+2 is published. Kafka says upgrade the JDK, not Kafka.

The short answer

Calif disclosed Java4Shell, CVE-2026-114938, a memory-corruption bug in OpenJDK's AVX-512 Base64 decoder. They score it 9.2 under CVSS 4.0. They demonstrated pre-authentication remote code execution, in default configurations, against Keycloak, Jira, Confluence, JFrog Artifactory, Jenkins, and PingFederate. After authentication, they demonstrated it against Kafka, Solr, Elasticsearch, Gerrit, and Spinnaker, and from sample applications on Spring Boot and Struts. A Java program that opens a TLS connection to a malicious server is in scope as well. Calif is holding the per-product exploits until operators have upgraded.

On Eclipse Temurin 17.0.21+9, HTTP Basic on Spring Security and on Tomcat kills the JVM before login. Both services exited 134 and wrote a fatal error log.

On the same build we also reached code execution before login, against a lab HTTP service whose only special behavior is decoding the request body with Base64.getDecoder(). The server kept running, and later valid Base64 requests still succeeded. It is ordinary Java: arrays and ByteBuffers, with no Runtime.exec, reflection, or Unsafe.

Oracle's November advisory names this CVE and scores it 8.1 under CVSS 3.1. The fixed builds shipped at 1:00pm PT: JDK 17.0.21.1 (17.0.21.1+4), 21.0.13.1, 25.0.5.1, and 27.0.1.1. Amazon Corretto 17.0.21.1.2 lists the CVE. Temurin 17.0.21.1+2 is published. Adoptium is still finishing the other platforms and the container images.

How it works

Base64 is how Java turns binary into text for credentials, tokens, uploads, and a lot of other protocol data. The ordinary decoder is Java. On an x86-64 CPU with AVX-512, OpenJDK also has a hand-written assembly fast path that decodes many bytes in one instruction. The JIT selects that path only after the call site has been compiled. A JVM that just started is still on the Java implementation.

The bug is in the tail, where the assembly accounts for = padding. This is the logic Calif published, in their notation. bzhiq keeps the low N bits of a value and clears the rest. bzhiq(-1, n) is a mask of n ones, except when n is 64 or more, in which case the mask stays all ones.

input_mask := bzhiq(-1, input_length)
output_len := (input_length / 4) * 3

if input[input_length - 1] == '=':
    output_len -= 1
    input_mask >>= 1
    if input[input_length - 2] == '=':
        output_len -= 1
        input_mask >>= 1

output_mask := bzhiq(-1, output_len)

For a malformed tail the first division produces an output_len of zero, and the padding branch then subtracts again. output_len becomes -1. bzhiq(-1, -1) does not clip the mask, so output_mask is 64 ones.

The store writes one vector under that mask. With every bit set, all 64 bytes are written:

evmovdqub(
    Address(dest, dp),
    k1,
    tmp,
    true,
    Assembler::AVX_512bit
);

The array the JVM allocated is shorter than that store. The write runs past the end of it. The Java decoder then rejects the input and throws. That check is too late. The bytes past the end are already written, and most of them are a fixed pattern. What the attacker influences is where the write lands, not the bytes in it.

Calif's chains start from that fixed overwrite. Overwriting the length of a neighboring array makes the array accept later, chosen bytes. A second array, copied into a response, reads heap back out. Calif restores the damaged objects so the JVM keeps running, then reaches code execution. Each product needs its own route into Base64.getDecoder and its own heap layout. There is no single payload.

Both overloads use that same AVX-512 intrinsic. decode(byte[], byte[]) writes into a buffer the application already allocated. On Spring Security and Tomcat that overflow kills the JVM. decode(byte[]) allocates the output array itself. A large allocation can sit on a G1 region boundary, so the overflow lands on the next object's length. That path led to code execution while the server kept running.

What we know

  • Bug: an out-of-bounds write in OpenJDK's AVX-512 Base64 decoder. Calif says the path needs an x86-64 CPU with avx512f, avx512bw, avx512vbmi, and bmi2. ARM64 is not affected. Intel Xeon from Ice Lake onward, and AMD Zen 4 onward, meet that bar.
  • Pre-auth: Calif's default-config code execution is on Keycloak, Jira, Confluence, Artifactory, Jenkins, and PingFederate. We confirmed a pre-login crash through HTTP Basic on Spring Boot 3.2.12 with Spring Security 6.2.8, and on Tomcat 10.1.62 with BASIC authentication.
  • Versions: OpenJDK 17.0.6 and newer. OpenJDK's 17 November advisory marks Java 17, 21, 25, and 27. Oracle's matrix lists 8u511b33-perf, 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3, 27.0.1.0.3, GraalVM for JDK 17.0.21.0.3 and 21.0.13.0.3, and GraalVM Enterprise 21.3.20.0.3. Standard Java 8 and 11 are not on this CVE.
  • Fixed builds: Oracle JDK 17.0.21.1+4, 21.0.13.1, 25.0.5.1, and 27.0.1.1. Corretto 17.0.21.1.2. Eclipse Temurin's Java 17 build, 17.0.21.1+2, is released: Adoptium's API lists it as the current Java 17 build, and the Linux x64 packages went up at 20:39 UTC on 18 November. Other platforms and the container images are still publishing as each one finishes testing. Red Hat and Microsoft have also started shipping. Red Hat's RHSA-2026:100567, issued 18 November, updates java-21-openjdk on RHEL 8 and 9 and lists CVE-2026-114938. Microsoft announced builds 17.0.21.1, 21.0.13.1, and 25.0.5.1 the same day. Because these cover Java 21 and 25, treat the flaw as affecting every supported Java line Oracle patched, not Java 17 alone. OpenJDK and Oracle score it 8.1 under CVSS 3.1. Calif scores it 9.2 under CVSS 4.0.
  • Warm decoder: C2 picks the AVX-512 intrinsic only after the Base64 call site has been compiled. A single request to a JVM that just started misses it.
  • Quiet heap: the JVM can keep serving traffic after the overflow. That is how the lab service reached code execution.
  • Crash: Spring Boot 3.2.12 with Spring Security 6.2.8, and Tomcat 10.1.62, on Temurin 17.0.21+9. Both exited 134 and wrote an hs_err_pid log.
  • Code execution: a lab HTTP service that decodes the request body with Base64.getDecoder(), on the same JDK. The server kept running.

What Hadrian is doing

  • Customers informed: we sent a security bulletin to all Hadrian users on 17 November.
  • Lab: HTTP Basic crashed Spring Security and Tomcat on Temurin 17.0.21+9 before login. The same JDK reached code execution on a lab HTTP service that decodes the request body with Base64.getDecoder(). Those probes are not what we run against customers. The crash checks kill the JVM, and the code-execution check is an exploit. Scanning and alerts will remain fingerprint-based for now.
  • Java runtime inventory: we are cataloguing the Java versions visible across customer attack surfaces. Solr, Spring Boot Actuator, Elasticsearch and OpenSearch often disclose the exact JVM build.
  • Known limit: we can often identify Java from the outside, including Java inside a container image or a third-party product. The exact build is the part that still needs an internal check when the application does not report it.

What to do now

  1. Find the products Calif named, and every other Java runtime. Start with Keycloak, Jira, Confluence, Artifactory, Jenkins, and PingFederate. Then Kafka, Solr, Elasticsearch, Gerrit, and Spinnaker. In Hadrian, open the Technologies page and search for Java, and for those products. If the version is blank, keep the asset on the list until the owner confirms the build.
  2. Get the exact build. For each runtime, record the service, the JVM build, the distribution, whether it is on the internet, and the owner. Include container images and Java shipped inside another product. Where Hadrian shows Java without a build, ask the owner for it.
  3. Install the fixed build, internet-facing services first. Oracle JDK 17 goes to 17.0.21.1, 21 to 21.0.13.1, 25 to 25.0.5.1, and 27 to 27.0.1.1. 8u511b33-perf goes to 8u513-perf. Corretto 17 goes to 17.0.21.1.2. Temurin 17 goes to 17.0.21.1+2. Microsoft Build of OpenJDK 17, 21, and 25 go to 17.0.21.1, 21.0.13.1, and 25.0.5.1. On RHEL 8 and 9, update java-21-openjdk from RHSA-2026:100567. GraalVM for JDK 17.0.21.0.3 and 21.0.13.0.3, and GraalVM Enterprise 21.3.20.0.3, take the November update.
  4. Until that build is installed, restart with -XX:-UseBASE64Intrinsics. That is Calif's mitigation. Only set this on Java versions that recognize the flag. Apache Kafka has warned that Java 8 does not recognize it and the JVM will not start with it set. On x86-64, -XX:UseAVX=2 is the other switch Calif names. Do not set UseAVX=2 on ARM. ARM JVMs do not recognize it and will not start.
  5. Rebuild container images. Patching the host leaves the JDK inside an image as it was. Rebuild the image and redeploy it. Products that bundle their own Java are affected even when the product needs no change. Apache Kafka has confirmed Kafka itself needs no upgrade because the fix is in the JDK, but current apache/kafka images still ship an affected Temurin runtime and must be rebuilt on a patched build.

While you patch, watch internet-facing Java services for hs_err_pid logs and for containers exiting 134 or 139. A service that is still online can already have run attacker code.

What happens next

CISA has told organizations to patch. The CVE is not in the Known Exploited Vulnerabilities catalog. Calif is still holding the per-product exploits.