Java2Shell / Java4Shell (CVE-2026-114938): heap overflow in the JVM's AVX-512 Base64 intrinsic
A JIT-compiled Base64 decoder on AVX-512 CPUs writes past its output buffer (CVSS 3.1 8.1, researcher CVSS 4.0 9.2). Who is really exposed, how to check a live JVM, the flag workaround and the fix.
Java2Shell (Harness’s name) or Java4Shell (Calif.io’s name, the original finders) is a memory-corruption bug inside HotSpot itself: the hand-written AVX-512 machine code the JIT uses to speed up java.util.Base64 decoding. It was disclosed and fixed on 17 November 2026. The headlines say “unauthenticated RCE in Java.” The reality is narrower but still serious, and this post is mostly about telling the two apart. Companion posts: PHP2Shell and Node2Shell.
Scope and ethics. This post covers architecture, exposure checks, detection and remediation. It contains no trigger strings. Run any validation on JVMs you own, in an isolated lab.
At a glance
| CVE | CVE-2026-114938 |
| Severity | CVSS 3.1 8.1 High, AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H (Oracle, via NVD). Calif.io scores it CVSS 4.0 9.2 |
| CWE | CWE-122 Heap-based Buffer Overflow |
| Component | HotSpot C2 compiler, x86-64 AVX-512 Base64 decode intrinsic |
| Affected (Oracle) | Java SE 17.0.21, 21.0.13, 25.0.5, 27.0.1 and earlier on those lines (17 from 17.0.6 onward), Oracle Java 8u511b33-perf only, GraalVM for JDK 17/21, GraalVM EE 21.3.20 |
| Fixed in | November 2026 update: 17.0.21.1 / 21.0.13.1 / 25.0.5.1 / 27.0.1.1 (OpenJDK distributors’ numbering may differ, so check yours) |
| Exploited? | No in-the-wild exploitation reported as of 20 Nov. Not in CISA KEV. CISA SSVC: exploitation none, automatable no, technical impact total. A memory-corruption PoC is public, but product RCE chains are not |
Description: how the bug works
java.util.Base64.Decoder works out the exact decoded length up front and allocates an output array of exactly that size. The pure-Java decoder then fills it with bounds-checked writes.
Hot code gets compiled by the C2 JIT, and on CPUs with the right AVX-512 extensions (VBMI, plus AVX512F/BW and BMI2) HotSpot swaps the inner loop for an intrinsic: hand-tuned vector assembly that decodes 64 bytes per instruction. The intrinsic isn’t given the destination length and doesn’t recheck it. It trusts that the Java caller sized everything correctly.
The bug is in the intrinsic’s padding path. Given a padded tail (=) shorter than one full vector block, the native code computes a negative “bytes remaining” count. That count turns into an AVX-512 store mask, the negative value saturates so every lane is enabled, and a full 64-byte vector store goes out starting near the end of the output array. Public lab work measured 62 bytes written past a 50-byte output. Java then notices the input is malformed and throws IllegalArgumentException, but the out-of-bounds write has already happened. An HTTP 401 or 400 response doesn’t mean nothing was corrupted.
The upstream fix (OpenJDK commit 5177a70, per public analyses) sends short padded tails back to the safe Java code path.
Why it’s narrower than the headlines
All of these must be true for a JVM to be exploitable:
- x86-64 with AVX-512 VBMI. That means Intel Ice Lake and later server and client chips, and AMD Zen 4/5. ARM64 (Graviton, Ampere, Apple silicon) and older x86 aren’t affected. In the cloud, whether you’re exposed can depend on the instance family your autoscaler happens to pick.
- An affected JDK build (17.0.6+, 21, 25, 27; not generic 8 or 11). Remember bundled JREs inside vendor products.
- The intrinsic is hot. Interpreted code takes the safe path, and the overflow only happens after C2 compiles the decode routine. Public tooling needed a warm-up of many valid decodes first. The exception can also deoptimize the method, so a one-shot scan can miss a vulnerable JVM.
- Attacker-controlled Base64 reaches
java.util.Base64. Unfortunately that’s everywhere:Authorization: Basicheaders, JWT segments, SAML/XML, SASL, API fields and queue messages. - Turning a 62-byte heap overwrite into code execution is application-specific. The public lab shows input → out-of-bounds write and nothing more (
shell_proven=false). Calif.io and Immersive say they have private product chains, with the pre-auth list including Keycloak, Jira, Confluence, Jenkins, PingFederate and possibly Artifactory, and authenticated paths in Kafka, Solr, Elasticsearch and Gerrit. None are public or independently verified.
So: patch with high priority on AVX-512 x86 hosts running identity, SSO and CI systems. Treat ARM fleets as not affected. Don’t page the whole company over a Java 8 desktop app.
Identifying affected systems
The running PID is the source of truth. An SBOM, image tag or package manager can say “patched” while a JVM started three weeks ago is still running the old code.
# 1) CPU gate: no avx512vbmi = not exploitable on this host
grep -o -m1 -w avx512vbmi /proc/cpuinfo || echo "no AVX-512 VBMI: not affected"
grep -m1 '^flags' /proc/cpuinfo | grep -ow -E 'avx512f|avx512bw|avx512vbmi|bmi2' | sort -u
# 2) Each running JVM: exact runtime version and whether the intrinsic is enabled
for pid in $(pgrep -f java); do
echo "== PID $pid: $(tr '\0' ' ' </proc/$pid/cmdline | cut -c1-120)"
jcmd "$pid" VM.version 2>/dev/null | sed -n '2,3p'
jcmd "$pid" VM.flags -all 2>/dev/null | grep -E '\bUseBASE64Intrinsics\b|\bUseAVX\b'
done
# 3) Installed JDKs and container images
java -version 2>&1
java -XX:+PrintFlagsFinal -version 2>/dev/null | grep -E '\bUseBASE64Intrinsics\b|\bUseAVX\b'
docker ps --format '{{.Image}}' | sort -u | xargs -I{} sh -c 'echo "{}:"; docker run --rm --entrypoint java {} -version 2>&1 | head -1'
# 4) Find bundled JREs inside vendor products
find / -xdev -type f -name 'libjvm.so' 2>/dev/null
A JVM is exposed if the CPU check passes, the version is in the affected range, and UseBASE64Intrinsics is true (it’s on by default on capable CPUs). UseAVX below 3 also turns off the AVX-512 path.
Safe validation in an isolated lab
- Use an AVX-512 VBMI host (or a cloud instance type that has it) on an isolated network.
- Install an affected build (e.g. Temurin 25.0.5) and the fixed build side by side.
- Run the checks above against each, and confirm your inventory tooling reports the live process version, not just the package.
- Start the affected JVM with
-XX:-UseBASE64Intrinsicsand confirmjcmd <pid> VM.flagsshows it. That’s how you check the workaround actually reached the process. - If you want to go further, the open-source zake1god/java2shell checker writes into a sentinel array and compares vulnerable and mitigated JVMs in-process, without targeting any network service. Use it only inside your lab.
Detection
There’s little to see on the wire. The trigger is just a slightly malformed Base64 value, so detection is mostly about effects:
- JVM crashes:
hs_err_pid*.logfiles mentioningStubRoutines/ Base64 stubs, orSIGSEGVin compiled code on identity, CI and SSO hosts. Collect them centrally. - Spikes in Base64 decode errors: bursts of
IllegalArgumentException: Illegal base64 character/Input byte array has incorrect ending bytein app logs, especially on auth endpoints (Basic auth, JWT parsing). - Odd auth failures: many 400/401s with unusually long
Authorization: Basicvalues or malformed JWT segments from a single source. - Process lineage:
javaspawningsh,bash,curl,wgetorcmd.exe. The usual signal that any Java RCE has been chained to a shell.
Remediation
- Patch the JDK/JRE to the November 2026 update (Oracle 17.0.21.1 / 21.0.13.1 / 25.0.5.1 / 27.0.1.1, or your OpenJDK vendor’s equivalent: Temurin, Corretto, Zulu, Red Hat, Microsoft and so on), plus GraalVM where used.
- Restart every JVM. This is the step most often missed. Then re-check with
jcmd <pid> VM.version. - Chase bundled runtimes. Keycloak, Atlassian, Jenkins, PingFederate and similar appliance or container images ship their own JREs, so apply the vendor’s update.
Workarounds (stopgaps, need a restart)
| Option | Effect | Cost |
|---|---|---|
-XX:-UseBASE64Intrinsics |
Forces the pure-Java decoder. Lab tests show 0 bytes written out of bounds | Slower Base64 only. Narrowest option |
-XX:UseAVX=2 |
Stops the JVM using AVX-512 at all | Broader slowdown in crypto, array and string intrinsics |
Add the flag to the service’s own JVM options (JAVA_OPTS, setenv.sh, systemd unit, Kubernetes manifest). JAVA_TOOL_OPTIONS works but applies to every JVM in that environment. Public write-ups report that the flag isn’t recognized on ARM and may stop the JVM from starting there. ARM isn’t affected anyway, so scope the flag to x86 hosts and test it before rolling out.
References
- CVE-2026-114938, NVD
- OpenJDK vulnerability advisory, 17 Nov 2026
- Oracle Security Alert, November 2026
- Calif.io: Java4Shell disclosure
- Harness: Past the end of the buffer
- Red Hat bulletin RHSB-2026-018
- Tenable FAQ
- SecureLayer7: What is Java2Shell · SecurityCipher lab analysis
Verify every version against the vendor advisory before acting. Published 20 Nov 2026.