Back to Blog

Java4Shell: pre-auth RCE in OpenJDK Base64 (CVE-2026-114938)

By Element Nov 2026 7 min read

Calif disclosed Java4Shell, CVE-2026-114938: a memory-corruption bug in OpenJDK’s AVX-512 Base64 decoder, scored 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 against sample applications on Spring Boot and Struts. Oracle shipped fixed builds on Nov 17: JDK 17.0.21.1+4, 21.0.13.1, 25.0.5.1, and 27.0.1.1, and Corretto 17.0.21.1.2 lists the CVE. Adoptium’s current Temurin 17 build, 17.0.21+9, is still the vulnerable October build.

We confirmed the vulnerability in our own lab: on live Keycloak and Jira instances running vulnerable JDK builds on AVX-512 server hardware, we reproduced the corruption primitive end-to-end and the remote crash forensics. Those probes can crash a JVM, so they are lab-only; against customer estates we alert on passive, version-and-fingerprint indicators instead, and never run trigger or crash-class traffic at services we don’t own.

How it works

Base64 is how Java encodes credentials, tokens, and protocol data, and on x86-64 CPUs with AVX-512, OpenJDK decodes it with a hand-written assembly fast path. The JIT picks that path only after the call site has been compiled; a JVM that just started still runs the ordinary Java decoder.

The bug is in the tail, where the assembly accounts for = padding. In Calif’s notation: bzhiq(-1, n) keeps the low n bits of a value and clears the rest, except when n is 64 or greater, in which case the mask stays all ones. For a malformed tail, the output-length computation produces zero, the padding branch subtracts again, and the length becomes -1. bzhiq(-1, -1) does not clip, so the output mask is 64 ones, and the final masked store writes all 64 bytes past the end of the array the JVM allocated. The decoder then rejects the input and throws, but 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.

Every triggering request looks like an ordinary malformed input. The application logs a standard rejection, returns a 400 or a 500 depending on the product line, and keeps running. There is no error signal.

Exploitation starts from that fixed overwrite. Overwriting the length of a neighboring array turns it into a “writer” that accepts later, chosen bytes; a second array, copied into a response, reads heap back out; the attacker repairs the damaged objects so the JVM survives garbage collection, then reaches code execution. Each product needs its own route into the decoder and its own heap layout. There is no single payload.

The two decode entry shapes behave differently. decode(byte[], byte[]) writes into a buffer the application already allocated, and overflowing it tends to kill the JVM. decode(byte[]) allocates the output array itself, and a large allocation can sit on a G1 region boundary, so the overflow lands on the next live object’s length. That is the quiet class: the server keeps running, which is how Calif reached code execution on a service that never went down.

What we know

  • Bug: an out-of-bounds write in OpenJDK’s AVX-512 Base64 decoder. The path needs an x86-64 CPU with avx512f, avx512bw, avx512vbmi, and bmi2: Intel Xeon from Ice Lake onward, AMD Zen 4 onward. ARM64 is not affected, and consumer Intel desktops are not affected. On those fleets the buggy code is compiled out entirely, and the 9.2 score collapses toward zero: an environmental rescore your risk team should actually perform.
  • Reach: pre-auth code execution in default configurations on Keycloak, Jira, Confluence, Artifactory, Jenkins, and PingFederate (Calif). Keycloak’s SAML artifact binding has decoded attacker-controlled SAMLart values through this exact code path since 2021, and we confirmed by decompilation that Jira’s filter chain decodes the Authorization: Basic header on every request before authentication. A Java program that opens a TLS connection to a malicious server is in scope as well.
  • Versions: OpenJDK 17.0.6 and newer. Oracle listed these vulnerable builds: 8u511b33-perf, 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3, and 27.0.1.0.3. The same decoder ships in Corretto, Temurin, the Microsoft Build of OpenJDK, Zulu, Liberica, SapMachine, Red Hat OpenJDK, Oracle Java SE, and GraalVM.
  • The version trap: the vulnerable October builds and the fixed November re-spins carry the same version numbers. “17.0.21” can be either. Triage by build date (Nov 17, 2026 or later) or by a behavioral test, never by version number alone.
  • 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 (its changelog prints CVSS 8.1; Calif scores 9.2 under CVSS 4.0). Adoptium’s current Temurin 17 build is still the vulnerable 17.0.21+9; install 17.0.21.1 when Adoptium publishes it.
  • Warm decoder: the JIT selects the AVX-512 intrinsic only after the Base64 call site has been compiled. A single request to a JVM that just started misses it, and every trigger deoptimizes the compiled decode path again. The network signature is mechanically periodic: bursts of well-formed decode traffic (tens of thousands of re-warm requests), then single malformed attempts, repeating. A sustained rate of malformed decodes without re-warm bursts is not this exploit.
  • Quiet heap: the JVM can keep serving traffic after the overflow. A service that is still online can already have run attacker code.

What Element is doing

  • We confirmed the vulnerability in the lab. On our own Keycloak and Jira instances, running vulnerable JDK builds on AVX-512 server hardware, we reproduced the corruption primitive end-to-end and the remote crash forensics. Because those probes can crash or destabilize a JVM, they are exactly what we do not run against customer systems.
  • Customer alerts are passive, by design. For customer estates, detection stays on version and fingerprint indicators: exposed Java runtimes and named products (Keycloak, Jira, Confluence, Artifactory, Jenkins, PingFederate first), build dates where the product or its error pages disclose them, and pre-auth decode routes such as Keycloak’s SAML artifact binding and Jira’s Basic auth filter chain. No trigger traffic, no crash probes, nothing that touches the decoder in a way the server would notice.
  • Why not “just test it”? The reliable version of the test is destructive, and the non-destructive remote options do not work: we calibrated every candidate signal, from status codes to latency profiles to JIT deoptimization transients, against a live vulnerable instance and a mitigated control, and they are identical across the two. Anyone claiming to remotely “scan for Java4Shell” is reading your version banner and guessing. We prefer to say so.

What to do now

  1. Inventory Java runtimes. Start with the pre-auth product list: Keycloak, Jira, Confluence, Artifactory, Jenkins, PingFederate. Then Kafka, Solr, Elasticsearch, Gerrit, Spinnaker. Include container images and Java shipped inside another product; patching the host leaves the JDK inside an image as it was.
  2. Get the exact build, not the version number. For each runtime, record the service, the JVM build and its build date, the distribution, whether it is internet-facing, and the owner. If the build is not visible from the outside, keep the asset on the list until the owner confirms 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. Corretto 17 goes to 17.0.21.1.2. Until a fixed build is installed, restart with -XX:-UseBASE64Intrinsics (Calif’s mitigation; on x86-64, -XX:UseAVX=2 is the other switch; do not set it on ARM, where the JVM does not recognize the flag and will not start). Rebuild container images and redeploy.
  4. Watch for the forensic signs. hs_err_pid logs, and containers exiting 134 or 139, on internet-facing Java services while you patch. A service that is still online can already have been exploited.
  5. Defense-in-depth. Have the fronting proxy or WAF reject oversized or oddly-padded Base64 values on inputs that reach a pre-auth decoder (SAML artifacts in Keycloak, the Basic auth header in Jira, tokens and API parameters elsewhere), and rate-limit repeated rejections there. The periodic warm-burst pattern described above is the attack’s network signature.

Element