# Java4Shell: What an OpenJDK Base64 Bug Leaves Behind, and Two Tools to Find It

URL: https://www.ionsec.io/resources/java4shell-openjdk-base64-rce
Category: Article
Author: IONSEC Team
Published: 2026-11-18
Tags: research, threat-intelligence, dfir, java, openjdk, rce, detection, open-source, cve-2026-114938

> Java4Shell, CVE-2026-114938, is an out-of-bounds write in the OpenJDK HotSpot x86-64 Base64 AVX-512 decode intrinsic. A Base64 string ending in 64 A characters followed by an equals sign makes a length underflow leave the AVX-512 store mask fully open, writing 62 bytes past a 50-byte buffer. Consequences range from a JVM crash to heap disclosure and code execution. OpenJDK 17.0.6 and newer on 17/21/25/27 branches, on x86-64 CPUs with AVX-512 VBMI and BMI2, are affected. Oracle fixed it in its November 2026 Critical Security Patch Update. IONSEC has published an open-source detector and a detection pack for it.

IONSEC is releasing an open-source detector and a detection pack for Java4Shell (CVE-2026-114938), the out-of-bounds write in OpenJDK's AVX-512 Base64 decoder. This is the incident responder's reading of the bug: who is exposed, what evidence an attempt leaves, how fast that evidence disappears, and the order to work in.

---
<figure class="rf rf-wide">
  <video controls preload="metadata" playsinline poster="/assets/blog/java4shell-openjdk-base64-rce/java4shell-motion-poster.png" style="width:100%;border-radius:8px;border:1px solid #2a2a3e;background:#050507">
    <source src="/assets/blog/java4shell-openjdk-base64-rce/java4shell-motion.mp4" type="video/mp4" />
    Your browser does not support the video tag.
  </video>
  <figcaption>One stray <code>=</code> in a <code>Basic</code> authorization header; the output length underflows to <code>-1</code>; 62 bytes land past the 50-byte buffer.</figcaption>
</figure>

**Two open-source tools ship with this post.** [`java4shell-detector`](https://github.com/ionsec/java4shell-detector) is a single read-only binary with three modes: `host` inventories every JDK on a machine and says which ones sit in the affected range on affected hardware, `net` fingerprints the Java services the researchers exploited without ever sending the trigger, and `hunt` sweeps disks for the JVM crash logs a failed attempt leaves behind. The **Java4Shell detection pack** in the same repository holds the Sigma rules, the Splunk, Elastic, Sentinel and Defender queries, an osquery pack, Suricata rules and per-product hunt guides. Both are AGPL-3.0. The rest of this post is the reasoning they are built on.

We are an incident response firm, so we read this bug with one question: what will an intrusion through it look like on a host we are handed three weeks from now, and what will already be gone? For Java4Shell the answer is uncomfortable. The failed attempts are loud, because they kill the JVM. The successful ones are quiet: the process keeps serving, the only log line is an exception every malformed token already produces, and nothing new is written to disk.

On 17 November 2026, [Calif](https://calif.io/java4shell/) disclosed CVE-2026-114938, a memory-corruption vulnerability in OpenJDK's Base64 decoder. Calif rates it 9.2 Critical under CVSS 4.0; Oracle's score on the [OpenJDK advisory](https://openjdk.org/groups/vulnerability/advisories/2026-11-17) is 8.1 High under CVSS 3.1. Oracle shipped fixes the same day in its November 2026 [Critical Security Patch Update](https://www.oracle.com/security-alerts/cspunov2026.html). The bug is an out-of-bounds write inside the HotSpot JVM's x86-64 AVX-512 Base64 decode intrinsic, the hand-written assembly stub that the C2 JIT compiler substitutes for `java.util.Base64.Decoder` at runtime. What has been demonstrated so far runs from a hard JVM crash to Heartbleed-style heap disclosure and code execution, reached without authentication in default configurations of widely deployed products.

One detail of the timeline matters to anyone scoping a hunt. Both [Tenable](https://www.tenable.com/blog/java4shell-cve-2026-114938-frequently-asked-questions-about-openjdk-rce-vulnerability) and [Upwind](https://www.upwind.io/blog/java4shell-what-we-know-now-and-what-comes-next) report that details of the flaw leaked before the patch existed. Nobody has published when. The hunt window therefore does not start on disclosure day.

The name is Java4Shell, and like Node2Shell before it, the pattern is a decoder bug in the runtime itself, reached through bytes that applications accept by design: authentication headers, form fields, file uploads, message payloads.

## The bug: a length underflow behind the JIT

Three facts about the code path frame everything else.

First, the vulnerable code only runs after warm-up. `java.util.Base64` starts as ordinary Java bytecode, and only after the C2 JIT compiler has compiled the call site does the AVX-512 stub execute. The [advisory](https://calif.io/java4shell/)'s proof of concept warms the decoder with 200,000 valid decodes before firing. Any test that sends one payload to a cold process and calls the result "not vulnerable" has tested nothing.

Second, the corruption is a miscount, not a type confusion. The intrinsic processes 256-byte blocks — 64 when the input is smaller — using vector stores (`evmovdqub`, VMOVDQU8) whose coverage is limited by a 64-bit store mask. The routine computes the output length from the input length and subtracts one for each padding byte. On certain tail forms the arithmetic runs below zero: `output_len` underflows to -1. The next step — masking a full -1 value down to `output_len` bits — is undefined for a negative operand and in practice leaves all 64 bits set. The store mask that was supposed to limit the final write to a few bytes now permits a full 64-byte write.

Third, the write itself is short and fixed. The canonical trigger is 64 `A` characters followed by one `=` — a 65-byte input that decodes into a 50-byte output buffer. The write starts at offset 48 and continues for 62 bytes past what the buffer owns. The JVM then throws `IllegalArgumentException` because the input is malformed, but the exception arrives after the corruption, not instead of it. On OpenJDK 17 the trigger is 128 `A` followed by `=` — that line's length threshold for reaching the code path is higher. Most bytes of the overshoot carry a constant; the first byte is attacker-chosen and the second partially so.

## From 62 bytes to code execution

Sixty-two fixed bytes past a small buffer does not sound like code execution, and it is not by itself. The published exploitation model chains three stages. The fixed overwrite lands on an adjacent object — an array length field. Changing a length converts the fixed write into a bounded linear write with a chosen value. That second primitive corrupts a further array whose contents the application later copies back out: the memory-disclosure primitive Calif calls JavaBleed. Heap contents — personal data, private keys, session tokens — leave the process in a legitimate-looking response. The mechanics are Heartbleed's, one application layer up.

The same primitives escalate. The write can reach the Code Cache — the JIT's own compiled-output memory — and JVM hook structures, which is the path to executing attacker-chosen code. Everything is built on remote heap grooming: spray objects and time request delivery with partial bodies and TCP pacing, so allocations happen mid-decode. This is timing-sensitive — Calif rented a same-region VM to keep jitter low — and it is why proxies that hold a request body until completion disrupt some grooming profiles. There is no universal exploit: every product needs a bespoke path — a decoder reached pre-authentication, a live writer array, a reader copied back, an application action that exfiltrates. Calif demonstrated pre-authentication code execution against Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins and PingFederate in default configurations, and post-authentication execution against Apache Kafka Broker, Apache Solr, Elasticsearch, Gerrit and Spinnaker. It has withheld the product-specific chains to give operators time to patch. [Upwind](https://www.upwind.io/blog/java4shell-what-we-know-now-and-what-comes-next), working independently on Temurin 17.0.6, 17.0.21, 21.0.13 and 25.0.5, reproduced the overflow and watched it corrupt the neighbouring heap object in most rounds, but does not claim code execution from its own lab. Immersive has said publicly that it built a working exploit, which [Tenable](https://www.tenable.com/blog/java4shell-cve-2026-114938-frequently-asked-questions-about-openjdk-rce-vulnerability) notes still has to be adapted per application. [Hadrian](https://hadrian.io/vulnerability-alerts/oracle-critical-security-patch-update-java-17-rce-claims)'s alert, as updated late on 17 November, sits between those positions: on Temurin 17.0.21+9, an HTTP Basic header carrying the trigger killed the JVM before login — process exit 134 with an `hs_err_pid` fatal-error log — against both Spring Security 6.2.8 and Tomcat 10.1.62; and against a lab HTTP service decoding request bodies with `Base64.getDecoder()`, Hadrian reports reaching code execution while the server kept serving subsequent requests. Take the primitive as confirmed and per-product reachability as uneven.

## Who is exposed

Two conditions must hold together: a vulnerable JVM, and hardware that runs the intrinsic.

**Versions.** OpenJDK 17.0.6 and newer, on branches 17.x, 21.x, 25.x and 27.x, carries the flaw. 17.0.6 is where the AVX-512 Base64 decoding work was [backported to the 17 line](https://bugs.openjdk.org/browse/JDK-8268276); 17.0.0 through 17.0.5, and standard Java 8 and 11, do not have the code. Because every major distribution builds from OpenJDK source, the blast radius is nearly the whole Java ecosystem: Oracle Java SE, Oracle OpenJDK, Oracle GraalVM for JDK, Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine and Red Hat OpenJDK.

| Distribution | Vulnerable through | Fixed build |
| --- | --- | --- |
| Oracle Java SE | 8u511b33-perf (only this 8u build); 17.0.21.0.3; 21.0.13.0.3; 25.0.5.0.3; 27.0.1.0.3 | 8u513-perf; 17.0.21.1+4; 21.0.13.1; 25.0.5.1; 27.0.1.1 |
| OpenJDK branches 17/21/25/27 | 17.0.6 and newer, pre-fix | 17.0.21.1; 21.0.13.1; 25.0.5.1; 27.0.1.1 |
| Amazon Corretto | builds before 17 November 2026 | 17.0.21.1.2 (and 21/25/27 equivalents) |
| Eclipse Temurin (Adoptium) | 17.0.21+9 still newest at disclosure | none published as of 18 November 2026 |
| Microsoft Build of OpenJDK | 17.0.21.0.2 and related pre-fix builds | none confirmed at disclosure |
| Azul Zulu | builds before the November 2026 update | November 2026 update (see the Zulu release notes for build numbers) |
| SAP SapMachine | pre-fix builds | sapmachine-17.0.21.1 (and 21/25/27 equivalents) |
| GraalVM (Oracle) | pre-fix builds | GraalVM for JDK 17.0.21.1 and 21.0.13.1, Enterprise 21.3.20.1 (November 2026 CSPU) |
| BellSoft Liberica / Red Hat OpenJDK | pre-fix builds | not confirmed as of 18 November 2026 |

([JFrog](https://research.jfrog.com/post/java4shell-vulnerability/)'s summary, Tenable's FAQ and Oracle's advisory define the fixed set; the [Adoptium API](https://api.adoptium.net/v3/assets/latest/17/hotspot) and the [Corretto changelog](https://github.com/corretto/corretto-17/blob/develop/CHANGELOG.md) pin the open-source side as of writing.)

Version strings mislead in a way worth spelling out, because inventories get it wrong in both directions. A three-segment `17.0.21` is vulnerable. A fourth segment of 1 or higher, `17.0.21.1`, is fixed. Oracle's five-segment build notation `17.0.21.0.3` sorts numerically below `17.0.21.1` and is vulnerable. On the 8u line, only the Oracle `8u511b33-perf` build is affected; a stock 8u511 is not.

**Hardware.** The decoder path runs only on x86-64 CPUs supporting all four of `avx512f`, `avx512bw`, `avx512vbmi` and `bmi2` — Calif lists Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids, and AMD Zen 4 or newer. That includes common cloud x86 instance families: Upwind reproduced the overflow on an AWS c6i (Ice Lake) instance. ARM64 is not affected. A quick Linux check:

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

All four lines must appear; three of four does not count. A JVM on a CPU without the full set cannot reach the vulnerable code, which is the one clean exclusion available in an environment where most runtimes will still be unpatched.

## What defenders can actually see

Detection for Java4Shell is partial, and it is better to say so than to sell a signature. Signals exist on the host and on the network, and each has a defined blind spot.

**Crash artifacts.** A trigger that reaches the intrinsic in an unexploited-but-corrupting way kills the process: exit code 134 (SIGABRT-class) or 139, with an `hs_err_pid*.log` fatal-error file. Hadrian reports exactly this artifact against Spring Security and Tomcat on Temurin 17.0.21+9, with the process dying before authentication completed. Exit 134 is shared with every JVM fatal error, so correlation does the work. A crash log whose frames name the Base64 decoder is the strongest form. Do not require it, though: heap corruption often surfaces later, in the garbage collector or in whichever thread touches the damaged object, so an `hs_err` file created seconds after a burst of malformed-Base64 requests deserves attention whatever its top frame says.

**Evidence that expires.** This is the part that decides whether an investigation is possible at all. HotSpot writes `hs_err_pid*.log` to the process working directory unless `-XX:ErrorFile` says otherwise. In a container that is usually the writable layer, which is discarded when the orchestrator replaces the crashed pod. The exit code survives only in orchestrator events and the previous-container status, and Kubernetes keeps events for one hour by default. A JVM that was exploited cleanly holds its evidence in heap memory alone, and the patch rollout you are about to run restarts every one of those JVMs. So collect before you fix: pull crash logs and restart history from internet-facing Java workloads first, and where indicators exist, take a heap or process dump before the restart.

**Application-log signals.** Bursts of `java.lang.IllegalArgumentException` from Base64 decode paths are the JVM's own aftermath signal: the decoder rejects the trigger only after corrupting memory. The exception is trivially floodable and fired by any malformed Base64, so it is a lead to correlate with slow-POST patterns — many small or paced requests from one client, which is what the request-streaming heap groom looks like from the web tier.

**The wire — with two caveats.** The canonical trigger is literal cleartext: 64 `A` followed by `=` (65 characters, `AAAA...A=`), and `A{128}=` on OpenJDK 17-line runtimes. The `A`s are the proof of concept, not the bug: what the decoder needs is a tail that ends in a stray `=`. Upwind's more general shape is a Base64-alphabet token of 32 or more characters ending in `=` whose length is not a multiple of four, which is the filter to prefer once attackers stop copying the advisory. The literal form appears in Authorization headers, JWT segments, multipart and raw bodies, and URL-decoded parameters. Any terminating proxy that logs what it decrypted can hunt for it, including the double-encoded form — the trigger base64-encoded again, as happens inside Basic credentials. The caveats are TLS and warm-up: TLS hides everything end to end unless you terminate it, and Kafka-style protocols have no HTTP surface to inspect. JIT warm-up means a first request to a cold JVM produces nothing, so low-volume exploitation can leave no network or log trace at all — which is why host-side signals and inventory coverage matter more.

**Request-body buffering is not a mitigation.** nginx buffering breaks some grooming profiles but not the class: one demonstrated chain runs from a single complete request, and post-WebSocket-upgrade frames bypass buffering. Do not list a buffering proxy as a compensating control.

**What the tools cover.** The detector's `host` mode reads each JDK home's `release` file, classifies the version against the fixed-build matrix (including the three-segment versus four-segment trap described above), and checks CPU flags and mitigation flags on running JVMs. `net` mode is inventory-only by design: it sends an HTTP `GET /`, a few well-known health paths and a Kafka ApiVersions ping, and never the trigger, because the trigger crashes a vulnerable service. `hunt` mode finds `hs_err` logs and flags the ones with Base64 frames. The detection pack covers the behaviours in this section: `hs_err` file creation, Java processes spawning shells, the cleartext trigger in its raw, single-encoded and double-encoded forms, exception bursts and slow-POST sources. Source, rules and release binaries are at [github.com/ionsec/java4shell-detector](https://github.com/ionsec/java4shell-detector).

<figure>
<img src="/assets/blog/java4shell-openjdk-base64-rce/detector-net-scan.png" alt="java4shell-detector running in a terminal: IONSEC lockup, license-accepted line, and a net scan reporting Jenkins (high, X-Jenkins 2.440.3), Solr (medium, Solr Admin) and Elasticsearch (high, 7.17.9) on a lab host, with the assessment line stating the trigger payload was never sent." loading="lazy" />
<figcaption>The IONSEC detector in <code>net</code> mode against a lab host: three product matches, zero exploit payloads sent. The binary asks for license acceptance before its first inventory run.</figcaption>
</figure>

## What to do, in order

1. **Inventory, and preserve, before anything else.** Before the first restart, copy `hs_err_pid*.log` files and container restart history off internet-facing Java workloads (see "Evidence that expires"). On Linux, collect CPU flags with the `grep` pipeline above and read every JDK or JRE `release` file's `JAVA_VERSION`/`IMPLEMENTOR` alongside each running `java` process cmdline, noting which JVMs already carry a mitigation flag (`-XX:-UseBASE64Intrinsics`, `-XX:UseAVX=2`, `-XX:DisableIntrinsic=_base64_decodeBlock`, `-Xint`, `-XX:TieredStopAtLevel`). Or run the IONSEC detector's `host` mode with `--format json` and it produces the same classification, including `mystery` status for homes without a `release` file. Include container images and vendor appliances; patching the host leaves the in-image JDK stale.

2. **Patch to fixed builds.** 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1 (8u513-perf for Oracle's Java 8 Enterprise Performance Pack), or vendor equivalents — Corretto 17.0.21.1.2 and the 21/25/27 equivalents, SapMachine's corresponding releases, Azul's November 2026 update, Oracle GraalVM's November CSPU (GraalVM for JDK 17.0.21.1 and 21.0.13.1). Rebuild container images from the patched base rather than patching running images. Temurin had published no fixed 17 build as of 18 November 2026 (the API still returned 17.0.21+9): if you run Temurin, apply the mitigation flags below and watch Adoptium release notices, or switch vendors for the interim.

3. **If patching is not immediate, use the JVM flag `-XX:-UseBASE64Intrinsics`.** It disables hardware-accelerated Base64 and directly removes the vulnerable code path. The alternative `-XX:UseAVX=2` disables AVX-512 wholesale, also works, but applies to x86-64 hosts only — on ARM64 the JVM does not recognize the flag and fails to start, which will break a fleet where a shared launch template propagates it. Those two are the flags Calif documents; neither Oracle nor the OpenJDK advisory mentions them. Other options keep C2 away from the stub: `-Xint` (interpreter only) or `-XX:TieredStopAtLevel` below 4, both at a heavy performance cost. `-XX:DisableIntrinsic=_base64_decodeBlock` also circulates, but it is a diagnostic option, and as Upwind found, a JVM given it without `-XX:+UnlockDiagnosticVMOptions` refuses to start. Do not paste it into a fleet-wide launch template. Whichever flag you use, confirm it on the running process, not in the config file.

4. **Isolate what is reachable without credentials.** The demonstrated pre-auth chains run through Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate. Anything internet-facing that decodes external Base64 before login or with broad authorization belongs behind access controls now, not after patching.

5. **Hunt retrospectively.** Details leaked before the patch and the leak date is not public, so do not anchor on 17 November: go back as far as your retention allows, and at least to mid-October. Search for `hs_err_pid*.log` files, JVM exits 134 or 139 on Java processes, `IllegalArgumentException` bursts with correlated slow-POST sources, and the literal trigger in terminating-proxy logs you own. Then check post-exploitation, which applies regardless of patch status: Java processes spawning shells or interpreters and unexpected outbound TLS from Java service identities (the client-side vector makes outbound connections attack surface too).

6. **Assume compromise where indicators exist.** JavaBleed returns heap contents — authentication sessions, private keys, tokens, data held in memory. If trigger-crash or exploitation indicators appear on a host, rotate the credentials that JVM could have held, invalidate sessions, and treat keys generated or loaded on that host as exposed.

7. **Verify, then schedule rebuilds.** After patching, re-run the inventory and confirm the fixed version string in every runtime, including images; build a recurring container-rebuild check so the next stale base image is caught by pipeline rather than by incident.

As of 18 November 2026 there is no confirmed exploitation in the wild, the CVE is not in CISA's KEV catalog, and no universal exploit exists. But the primitive is independently reproduced, details were circulating before the fix, and working chains exist in more than one set of private hands. If you find an indicator and want a second pair of eyes on it, that is the work IONSEC does.

## Sources

1. Calif — *Java4Shell: Write once, RCE everywhere*, the full advisory — <https://calif.io/java4shell/>
2. OpenJDK — *Vulnerability Advisory 2026-11-17* — <https://openjdk.org/groups/vulnerability/advisories/2026-11-17>
3. Oracle — *Critical Security Patch Update Advisory, November 2026* — <https://www.oracle.com/security-alerts/cspunov2026.html>
4. CVE-2026-114938 — record — <https://www.cve.org/CVERecord?id=CVE-2026-114938>
5. oss-security — *CVE-2026-114938: OpenJDK pre-auth RCE via memory-corruption in Base64 decoder*, disclosure thread — <https://www.openwall.com/lists/oss-security/2026/11/17/31>
6. JFrog Security Research — *Java4Shell: What We Know About the Critical OpenJDK RCE Vulnerability (CVE-2026-114938)* — <https://research.jfrog.com/post/java4shell-vulnerability/>
7. Wiz — *CVE-2026-114938 RCE in OpenJDK: Everything You Need to Know* — <https://www.wiz.io/blog/cve-2026-114938-rce-java4shell-openjdk>
8. Hadrian — *Java4Shell (CVE-2026-114938): pre-auth memory corruption in OpenJDK*, independent verification — <https://hadrian.io/vulnerability-alerts/oracle-critical-security-patch-update-java-17-rce-claims>
9. Amazon Corretto 17 — CHANGELOG.md, 17.0.21.1.2 fix entry — <https://github.com/corretto/corretto-17/blob/develop/CHANGELOG.md>
10. Adoptium — releases API, Eclipse Temurin 17 latest — <https://api.adoptium.net/v3/assets/latest/17/hotspot>
11. Upwind — *Java4Shell: What We Know Now and What Comes Next* — <https://www.upwind.io/blog/java4shell-what-we-know-now-and-what-comes-next>
12. Tenable — *Java4Shell (CVE-2026-114938): Frequently asked questions* — <https://www.tenable.com/blog/java4shell-cve-2026-114938-frequently-asked-questions-about-openjdk-rce-vulnerability>
13. OpenJDK bug tracker — *JDK-8268276: Base64 Decoding optimization for x86 using AVX-512* (17.0.6 backport) — <https://bugs.openjdk.org/browse/JDK-8268276>
14. IONSEC — *java4shell-detector* and detection pack, AGPL-3.0 — <https://github.com/ionsec/java4shell-detector>
15. Oracle — *Release notes for Oracle GraalVM for JDK 17*, 2026-11-17 CSPU entries — <https://docs.oracle.com/en/graalvm/jdk/17/docs/release-notes/>
