[ Vulnerabilities ]

Java4Shell: how to check exploitability on every JVM you run

White Java logo in a dark browser window

CVE-2026-114938, known as “Java4Shell”, is a heap out-of-bounds write in OpenJDK’s AVX-512 Base64 decoder. Calif, who found it, reports chaining it to remote code execution in default installs of Jira, Confluence, Jenkins, Keycloak and others. It scores 9.2 under CVSS 4.0. Oracle and OpenJDK released fixes on November 17, 2026, and as of November 18 no exploitation in the wild has been reported.

As always, best practice is to patch, then restart every JVM. A patched JDK on disk doesn’t fix a JVM that’s already running.

The harder question is where you’re actually exposed. The same JDK can be exploitable on one machine and safe on another, and checking from the outside is hard to do safely. So we built java4shell-check, a free, open-source, read-only checker that assesses exploitability where your JVMs run. The fastest way to use it is to hand it to your coding agent:

Check our environment for Java4Shell (CVE-2026-114938) with https://github.com/MazeResearch/java4shell-check.
Clone it and follow its AGENTS.md. Stay read-only, ask me before running anything on
other machines or cloud accounts, and give me the report.

The agent follows the repo’s AGENTS.md. It checks what it can reach, asks before touching any other machine or cloud account, and gives you a report of every JVM it found. The tool sends nothing to your services and changes nothing. As with any agent, give it read-only credentials.

Are you exposed?

For this vulnerability to be exploitable, all three conditions below must be true in your environment:

  • An affected JDK. OpenJDK 17.0.6 through 17.0.21, 21 through 21.0.13, 25 through 25.0.5 and 27 through 27.0.1, plus the HotSpot builds made from them (Corretto, Temurin, Zulu, Liberica, SapMachine, Red Hat, Microsoft, Oracle). Oracle also lists its Java 8 -perf build and GraalVM for JDK. End-of-life releases 22 to 24 and 26 contain the code and won’t get a fix.
  • An x86-64 CPU with AVX-512 VBMI. In practice, Intel Ice Lake or newer and AMD Zen 4 or newer. The host needs all four of avx512f, avx512bw, avx512vbmi and bmi2.
  • The Base64 intrinsic switched on. It is by default.

You can relax about ARM64 (including Graviton and Apple Silicon), Eclipse OpenJ9 / IBM Semeru, and standard Java 8 and 11 builds. None of them run the vulnerable code.

The highest risk is an internet-facing service on that hardware that decodes attacker-supplied Base64 before login. Common places are HTTP Basic auth headers, token handling and file uploads, depending on whether your framework uses java.util.Base64. Don’t stop at servers, though. Calif also describes a client-side variant, where a Java client that connects to a malicious TLS server can be hit. That puts build agents, integration workers and CLI tools in scope.

Why scanning for it is so hard

When a critical vulnerability drops, the usual move is a network probe that makes vulnerable servers respond differently. For Java4Shell, that is very hard to do safely. The fix removes a write, not a behavior. Based on the upstream change, patched and unpatched JVMs should return the same response, throw the same IllegalArgumentException and log the same lines. The difference that matters is the heap corruption itself, so a probe that reliably tells them apart is likely to sit very close to the exploit.

Expect product-specific probes anyway, for Confluence or Jenkins for example, that look for a side effect of the corruption. Be careful with them. To get any signal, such a probe has to corrupt memory on a vulnerable server first, and it can crash it. It also needs the decoder to be JIT-compiled. An unpatched JVM that was just restarted may not have compiled the vulnerable path yet, so it can look fixed during the very window when everyone is restarting to patch. A clean result from a remote probe is weak evidence that you’re safe.

Don’t run proof-of-concept code against production. If it behaves differently on a vulnerable server, it has probably already corrupted the heap. Checking where the JVM runs is safer and more reliable.

Check it

With an agent. Paste the prompt above. The agent asks what’s in scope, then works out what it can reach (this machine, Docker, other Linux machines you can get to, AWS accounts) and runs the right check for each. Before it calls a cloud API or runs anything on another machine, it shows you the targets and the exact command and waits for your yes.

You get a Markdown report. Here’s part of one from a test machine running six services in containers. We simulated an x86 CPU with AVX-512 VBMI, because our lab machine is ARM, and made up the names. The rest is unedited output.

## Summary

| Class | JVMs / targets | Meaning |
|---|---|---|
| VULNERABLE | 1 | Affected JDK on an AVX-512 VBMI CPU with the intrinsic enabled. **Act now.** |
| RESTART_REQUIRED | 1 | JDK replaced on disk; the running JVM still has the old code |
| UNCERTAIN | 0 | Could not be decided; see what to confirm |
| PROBABLY_FIXED | 1 | Patch-level build of the last affected update; confirm with the vendor |
| MITIGATED | 1 | Affected JDK, intrinsic disabled by flags. Patch anyway |
| NOT_VULNERABLE | 2 | Code absent, fixed, or CPU cannot run it |

## Vulnerable: act now

| Where | JDK | Version | Flags |
|---|---|---|---|
| ip-10-0-12-34 / container checkout-api-7d9f8 / pid 28377 | Eclipse Adoptium /opt/java/openjdk | 21.0.13 (AFFECTED_VERSION) | default(enabled) |

## Restart required

| Where | Version on disk | Flags |
|---|---|---|
| ip-10-0-12-34 / container orders-api-8e4a7 / pid 28717 | replaced-on-disk(now:21.0.13) | default(enabled) |

In this run, checkout-api is exploitable as it stands. orders-api was upgraded on disk, but the running JVM still has the old code until it restarts.

Before release we ran it on real AWS machines: 63 JVMs on 4 nodes, including Intel Sapphire Rapids and AMD Zen 4, and every verdict matched what each JVM reported about itself.

By hand. On each Linux machine, check the single-file script against the release’s SHA256SUMS.txt and run it as root, or it won’t see other users’ JVMs. Its host mode only reads /proc: it doesn’t start or attach to any JVM, and one run covers every JVM on the machine, containers included. Then merge the outputs into one report:

REL=https://github.com/MazeResearch/java4shell-check/releases/latest/download
curl -fsSL -O $REL/j4s-check.sh -O $REL/SHA256SUMS.txt
sha256sum -c SHA256SUMS.txt --ignore-missing
mkdir -p j4s-results
sudo sh j4s-check.sh host > j4s-results/$(hostname).txt 2>&1
sh j4s-check.sh report j4s-results/* > java4shell-report.md

The same script checks narrower targets too: port for a single service, container for a running Docker container and every JVM in it, and image for a Docker image.

On AWS, from a clone of the repo. You don’t need to log into every box. It works in two steps, one region at a time. A read-only API sweep reads each instance’s family, which fixes its CPU, to find the instances that could be hit. Then AWS Systems Manager (SSM) Run Command runs the host check on those instances, to see which JVMs are actually running there and how they’re configured:

./cloud/aws-sweep.sh --region us-east-1                       # which instances CAN be hit (API only)
./cloud/aws-ssm-host-check.sh --region us-east-1              # dry run: lists targets, sends nothing
./cloud/aws-ssm-host-check.sh --emit-payload /tmp/j4s.sh      # review exactly what will run
./cloud/aws-ssm-host-check.sh --region us-east-1 --run --out j4s-results/aws.tsv

The sweep clears ARM and older x86 capacity in seconds. The SSM step runs the host check as root on each remaining candidate, writes nothing to disk, and collects every running JVM it finds. Instances SSM doesn’t manage or can’t reach are listed as not checked. Read the payload before you run it.

Run it per node, not per image, because the same image can be exploitable on an Ice Lake node pool and safe on a Graviton one. Fargate, managed Kafka and other runtimes you can’t log into are harder. Checking the image in CI tells you its JDK and flags, but not the CPU underneath, so assume that CPU can run the bug, or follow the provider’s bulletin.

The exit code is 1 for vulnerable and 0 for not exploitable, with the reason printed. 3 means it needs a restart or a confirmation, and the output says which; 2 means the check itself failed. Anything the tool couldn’t read is reported as uncertain, and any machine it couldn’t reach as not checked, never as safe.

Where checks go wrong

We ran into each of these while building the tool.

  • Patched isn’t fixed until you restart. A running JVM keeps the old code after the package upgrade. The tool spots the replaced libjvm.so and reports RESTART_REQUIRED.
  • Your laptop will tell you you’re safe. Apple Silicon and many CI runners can’t run the vulnerable code, and an amd64 image under emulation hides AVX-512. An affected JDK checked there is only safe on that machine. The tool says so, and treats results from an emulated CPU as uncertain.
  • The flag you set may not be the flag in effect. -XX:-UseBASE64Intrinsics followed by -XX:+UseBASE64Intrinsics leaves the intrinsic on, and _JAVA_OPTIONS overrides the command line. Grepping for the mitigation isn’t enough, which our own first version learned the hard way. The tool now resolves the effective value. It asks the running JVM with jcmd where it can, and otherwise applies the JVM’s own precedence rules to the command line, argfiles and environment.
  • -XX:UseAVX=2 takes ARM services down. It mitigates on x86-64, but an ARM JVM refuses to start with it. Pushed across a mixed fleet, it causes an outage.

Fix it, then watch

  1. Patch. Oracle’s fixed builds are 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1, plus 8u513-perf for the Java 8 Performance Pack. Amazon shipped Corretto 17.0.21.1.2 on November 17. Temurin, Zulu, Microsoft, Red Hat and the Linux distributions release on their own schedules, so use the build your vendor names in its advisory, and make sure that advisory lists CVE-2026-114938. The checker reports patch-level builds like 21.0.13.1 as PROBABLY_FIXED until it can confirm them; for Oracle’s builds above, the release notes do. Then restart every JVM, and rebuild container images, including ones pinned to old digests.
  2. Verify the running version, not the one on disk, with jcmd <PID> VM.version, or with the checker’s host or port mode.
  3. If you can’t patch today, set JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics, restart, and verify. It works on every architecture. Base64-heavy workloads may get a bit slower.
  4. Watch for attempts. Every trigger ends in = padding but its length isn’t a multiple of four, so Java rejects it. Look for that shape in WAF or proxy logs, for IllegalArgumentException from java.util.Base64$Decoder on endpoints that don’t need a login (if you log them), and for unexplained JVM crashes (hs_err_pid*.log). None of this blocks an attack, and a quiet log doesn’t mean you’re clear.

What the tool can and can’t tell you

java4shell-check answers one question: can this JVM be exploited where it runs? It answers from the JDK version, the CPU and the flags in effect, and claims nothing beyond that.

What it can’t tell you is whether an attacker can reach the decoder at all. A JVM that meets all three conditions is only exploitable if attacker-controlled input ends up in java.util.Base64 somewhere in your code. That’s what Maze checks. It traces your code to see whether attacker input reaches the decoder, then checks the flags and CPU where that service runs, and tells you whether it’s actually exploitable.

The tool is MIT-licensed, runs on Linux (x86-64 and ARM64) and needs nothing beyond a POSIX shell. To run it, start with the prompt at the top of this post.

References