Java4Shell (CVE-2026-114938): How to Check If You're Exposed and Fix It
Java4Shell needs an affected JDK, an AVX-512 VBMI CPU and attacker Base64 to line up. How to check each one, patch, mitigate and hunt for attempts.

- Java4Shell (CVE-2026-114938) is a heap overflow in HotSpot's AVX-512 Base64 decoder, scored 8.1 (CVSS 3.1) by Oracle and 9.2 (CVSS 4.0) by Calif, the firm that found it.
- Fixed OpenJDK builds are 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Oracle's own November builds ending in .0.3 are still affected.
- The bug only exists on x86-64 CPUs with AVX-512 VBMI: Intel Ice Lake and newer, AMD Zen 4 and newer. ARM64, Graviton, Skylake-SP and Cascade Lake are not affected.
- UseBASE64Intrinsics=true does not prove exposure. HotSpot turns it on for Cascade Lake too, but the vulnerable code path also requires avx512vbmi.
- The URL-safe decoder takes the same vulnerable path, so JWT parsing counts. Patch the runtime instead of trying to prove no input reaches the decoder.
Checking the Java version is not enough for Java4Shell. The same JDK build can be vulnerable on one server and safe on another, because the vulnerable code is only generated on certain Intel and AMD CPUs.
Java4Shell (CVE-2026-114938) is a heap buffer overflow in the x86-64 AVX-512 fast path that OpenJDK's HotSpot JVM uses to decode java.util.Base64 input. A crafted Base64 string with a padded tail makes the JIT-compiled stub write 62 or 63 bytes past the end of a heap array. Calif disclosed it on November 17, 2026, at the same time Oracle and OpenJDK shipped fixes.
Two scores are in circulation. The OpenJDK advisory and Oracle's November Critical Security Patch Update rate it 8.1 under CVSS 3.1 (network, high complexity, no privileges, no user interaction, high impact on confidentiality, integrity and availability). Calif rates it 9.2 under CVSS 4.0. Endor Labs notes the vector string for that score has not been published.
This guide covers the three conditions that decide whether a system is exposed, a command to check each one, and what to do if you can't patch right away. Version numbers come from the OpenJDK advisory, Oracle's risk matrix and the OpenJDK source code.
The three conditions for exposure
A JVM is exposed only when all three of these are true:
- The JDK build. OpenJDK 17.0.6 or later, or any 21, 25 or 27 release, older than the November 17 fix. Standard Java 8 and 11 builds don't contain the vulnerable stub.
- The CPU. x86-64 with both AVX-512 VBMI and AVX-512 BW. That means Intel Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids, or AMD Zen 4 and newer.
- The input. Attacker-influenced Base64 has to reach the basic or URL-safe java.util.Base64 decoder, in code the C2 JIT has already compiled. Calif's proof of concept warms the decoder with 200,000 valid decodes first.
The first two are quick to check and give a clear yes or no. The third is much harder to rule out, and we don't recommend relying on it. The section on input explains why.
1. Is your JDK build affected?
The OpenJDK advisory lists the affected versions as 27.0.1.0.3, 25.0.5.0.3, 21.0.13.0.3, 17.0.21.0.3 "and earlier". Those .0.3 builds are the November Critical Patch Update releases themselves, so being on last month's patch level doesn't help. The fix ships in the next build on each line.
| Release line | Affected | First fixed OpenJDK build | Notes |
|---|---|---|---|
| Java 17 | 17.0.6 up to 17.0.21.0.3 | 17.0.21.1 | 17.0.0 to 17.0.5 have no x86 decode stub (Endor Labs). Shortest trigger is 129 characters. |
| Java 21 | Up to 21.0.13.0.3 | 21.0.13.1 | Shortest trigger is 65 characters. |
| Java 25 | Up to 25.0.5.0.3 | 25.0.5.1 | Shortest trigger is 65 characters. |
| Java 27 | Up to 27.0.1.0.3 | 27.0.1.1 | Shortest trigger is 65 characters. |
| Java 11 | Not affected | Not applicable | 11.0.33.0.3 appears in the same advisory for other CVEs, not this one. |
| Java 8 | Standard builds not affected | Not applicable | Oracle lists its 8u511b33-perf performance build as affected. |
| Oracle GraalVM | GraalVM for JDK 17.0.21.0.3 and 21.0.13.0.3; GraalVM Enterprise 21.3.20.0.3 | See Oracle's advisory | Listed in Oracle's Java SE risk matrix for CVE-2026-114938. |
We checked the public OpenJDK update repositories on November 18, 2026. The fix commit, JDK-8393212, is titled simply "Base64 optimization improvements". It is present in the jdk-17.0.21.1-ga, jdk-21.0.13.1-ga, jdk-25.0.5.1-ga and jdk-27.0.1.1-ga tags. Endor Labs reported on November 17 that the 17, 21 and 25 fixes were not yet public. They are now.
The fix itself is four lines in src/hotspot/cpu/x86/stubGenerator_x86_64.cpp. It sends any padded tail shorter than one 4-character Base64 unit back to the scalar decoder, which is exactly the case where the AVX-512 path miscomputes its store mask:
__ BIND(L_finalBit);
// Now have 1 to 63 bytes left to decode
+ // A padded Base64 tail shorter than one complete block is handled by Java.
+ __ cmpl(length, 4);
+ __ jcc(Assembler::less, L_bruteForce);
+
// I was going to let Java take care of the final fragmentDownstream builds such as Eclipse Temurin, Amazon Corretto, Azul Zulu, Microsoft Build of OpenJDK, Red Hat OpenJDK, SAP SapMachine and BellSoft Liberica release on their own schedules. Calif lists all of them as built from affected OpenJDK code. A version number doesn't mean the same thing across vendors, so look for CVE-2026-114938 in your vendor's release notes rather than assuming.
# Every running JVM on this host: binary path and exact version.
# Run jcmd as the same user that owns the JVM process.
for pid in $(pgrep -x java); do
echo "== PID $pid $(readlink -f /proc/$pid/exe)"
sudo -u "$(ps -o user= -p "$pid")" jcmd "$pid" VM.version
done
# Kubernetes: list every image, then check the JDK inside the ones that run Java.
# The JDK lives in the image, not in your pom.xml.
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}/{.metadata.name}{"\t"}{range .spec.containers[*]}{.image}{" "}{end}{"\n"}{end}'
kubectl exec -n <namespace> <pod> -- java -version2. Does your CPU support AVX-512 VBMI?
HotSpot only generates the vulnerable AVX-512 decode loop when the CPU reports both AVX-512 VBMI and AVX-512 BW. We read generate_base64_decodeBlock() in the jdk-17.0.21.0.3 source to confirm this. Without both features, HotSpot uses the non-AVX decode loop instead, which doesn't have the bug.
# All four flags must print for the vulnerable path to exist.
# Works on the host or inside any container on it: containers see the host's CPU flags.
grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'
# Kubernetes clusters running Node Feature Discovery expose the flag as a node label
kubectl get nodes -L feature.node.kubernetes.io/cpu-cpuid.AVX512VBMIDon't use the UseBASE64Intrinsics flag as your CPU test. In JDK 17, HotSpot's vm_version_x86.cpp turns it on whenever UseAVX is above 2 and the CPU has AVX-512 VL and BW. Skylake-SP and Cascade Lake Xeons meet that bar but have no VBMI, so the flag reads true while the vulnerable loop is never generated. A scan that keys on the flag alone will over-report on older Xeon fleets.
| Instance family | Processor | AVX-512 VBMI | Vulnerable path generated? |
|---|---|---|---|
| AWS M5 | Intel Skylake / Cascade Lake | No | No |
| AWS M6i | Intel Ice Lake (3rd Gen Xeon Scalable) | Yes | Yes |
| AWS M7i | 4th Gen Intel Xeon Scalable (Sapphire Rapids) | Yes | Yes |
| AWS M6a | AMD EPYC Milan (Zen 3) | No AVX-512 | No |
| AWS M7a | 4th Gen AMD EPYC Genoa (Zen 4) | Yes | Yes |
| AWS Graviton | ARM64 | Not applicable | No |
| GCP N2 | Cascade Lake or Ice Lake | Depends on the host | Depends on the host |
| GCP C3 | Intel Sapphire Rapids | Yes | Yes |
| GCP C3D | AMD EPYC Genoa | Yes | Yes |
GCP N2 needs extra care. Google's documentation says N2 defaults to Cascade Lake for machine types up to 80 vCPUs, and uses Ice Lake for larger types or when Ice Lake is set as the minimum CPU platform. Two N2 VMs in the same project can be on different CPUs. The same applies to autoscaled pools that mix instance types. Check each node, not just the instance family.
3. Can untrusted Base64 reach the decoder?
A JVM that never decodes attacker-controlled Base64 can't be exploited. Proving that is difficult, for four reasons:
- The URL-safe decoder is in scope. JFrog's write-up left this as an open question. The HotSpot source answers it: Base64.getUrlDecoder() loads a different lookup table, then jumps into the same AVX-512 loop and the same padding logic. Only the MIME decoder is routed away to the scalar path.
- JWTs use base64url and are decoded before authentication. auth0's java-jwt library, for example, calls Base64.getUrlDecoder().decode() on the token header and payload inside JWTDecoder, before any signature check runs.
- Frameworks decode on your behalf. HTTP Basic credentials, SAML assertions and many cookies are Base64 on the wire. Whether your stack decodes them with java.util.Base64 or its own codec is something you'd have to check library by library.
- Clients are affected too. Calif describes a client-side exploit in which a Java program that opens a TLS connection to a malicious server can be compromised.
Reachability analysis works well when the vulnerable function is in a library you can upgrade separately and the call graph is your own code. Here the bug is in the JVM, the call graph would need to cover the JDK and every framework on the classpath, and the fix is a JDK upgrade. Use reachability to decide which services to patch first, not whether to patch.
Remediation, in order
- Upgrade the JDK to 17.0.21.1, 21.0.13.1, 25.0.5.1 or 27.0.1.1, or your vendor's build that lists CVE-2026-114938 as fixed. Then restart every JVM. The bug is in JIT-generated code, so an upgraded JDK on disk does nothing for a process that started before it.
- Rebuild container images. If a Dockerfile starts FROM eclipse-temurin:21-jre, the fix only arrives after that tag is rebuilt upstream and you rebuild and redeploy on top of it. Images pinned by digest stay vulnerable until you bump the digest.
- Patch in this order: hosts with AVX-512 VBMI CPUs first, then internet-facing services, then anything that decodes tokens or other Base64 from unauthenticated callers. Calif names Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate as pre-auth RCE targets in default configurations.
- If you can't upgrade this week, apply one of the JVM flags below, confirm it took effect in the running process, and put a removal date on it.
- Once patched, remove the flag. Even the narrowest option gives up the Base64 intrinsic speed-up, and -XX:UseAVX=2 disables all AVX-512 code generation.
Mitigation flags if you can't patch yet
Endor Labs lists three options, from narrowest to broadest. Calif and JFrog give the second and third. Each one stops the JVM from using the vulnerable stub.
# 1. Narrowest: disable only the Base64 decode intrinsic
export JAVA_TOOL_OPTIONS="-XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_base64_decodeBlock"
# 2. Disable both the Base64 encode and decode intrinsics
export JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics"
# 3. Broadest: disable all AVX-512 code generation (x86-64 hosts ONLY)
export JAVA_TOOL_OPTIONS="-XX:UseAVX=2"
# Confirm the flag is live in the same JDK and environment your service uses
java -XX:+PrintFlagsFinal -version 2>/dev/null | grep -E ' (UseAVX|UseBASE64Intrinsics|DisableIntrinsic) 'Don't bake -XX:UseAVX=2 into a multi-arch image. Calif warns that OpenJDK on ARM doesn't recognise the flag and will fail to start. If one image runs on both x86-64 and Graviton nodes, set the flag per node pool instead.
A reverse proxy does not mitigate this. Calif found that nginx request buffering (proxy_request_buffering) breaks some of its exploits, but it is not a general defence: the Elasticsearch exploit still works, and WebSocket frames are not buffered.
Detecting exploitation attempts
As of November 17, no in-the-wild exploitation had been reported and CVE-2026-114938 was not in CISA's Known Exploited Vulnerabilities catalog, according to Endor Labs. Calif is withholding its weaponized chains until users upgrade. But its bounded trigger is public, and Endor notes that the fixed-pattern overwrite usually just crashes the JVM. So the most likely near-term impact is an unauthenticated crash (denial of service), even where code execution is hard.
Indicators to look for, mostly from Endor Labs' guidance:
- JVM crash logs (hs_err_pid*.log) showing SIGSEGV in a GC copy routine with a Base64$Decoder.decode0 frame on the stack.
- Bursts of IllegalArgumentException from java.util.Base64 during request handling. Java throws only after the out-of-bounds write has happened, so these exceptions are the clearest sign in application logs.
- Base64 fields that end in = or == but whose length isn't a multiple of 4. Endor rates this the highest-fidelity network signal.
- High-rate, unusually paced or fragmented Base64-heavy traffic from one source. Calif's exploits depend on heap grooming and network timing.
# JVM crash logs that mention the Base64 decoder (default location: the JVM's working directory)
find / -name 'hs_err_pid*.log' -mtime -14 2>/dev/null | xargs -r grep -l 'Base64\$Decoder'
# Decoder exceptions in application logs (exception messages from java.util.Base64, JDK 17)
grep -cE 'Input byte array has (wrong 4-byte ending unit|incorrect ending byte)|Last unit does not have enough valid bits' /var/log/<app>/*.log| Technique | ID | Java4Shell scenario |
|---|---|---|
| Exploit Public-Facing Application | T1190 | Pre-auth RCE against servers that decode request Base64, per Calif's named targets |
| Exploitation for Client Execution | T1203 | Java client compromised by a malicious TLS server, per Calif |
| Endpoint Denial of Service: Application or System Exploitation | T1499.004 | Crashing the JVM with the fixed-pattern overwrite |
Why dependency scanners miss it
Java4Shell is in the JDK, not in a Maven or Gradle dependency. A scanner that reads pom.xml or build.gradle and walks your dependency tree has nothing to match, because the JDK is never declared there. The affected component is whatever java binary ends up in your container image or on your host.
To catch it, your inventory has to include the runtime: an image-level SBOM that records the JDK package and its exact version, matched against the advisory. Check whether your scanner reports CVE-2026-114938 against your base images. If it doesn't, it isn't scanning the JDK, and it will miss future JVM bugs too.
What's still unconfirmed
- Per-product exploitability. Calif claims pre-auth RCE in default configurations of six products and post-auth RCE in Kafka, Solr, Elasticsearch, Gerrit and Spinnaker. No public exploit chains exist yet to verify these claims independently.
- The CVSS 4.0 vector behind Calif's 9.2 score, which hasn't been published.
- Downstream fixed version numbers. Temurin, Corretto, Zulu, Red Hat and distro packages each number their fixed builds differently, so read the vendor's advisory.
- Oracle's fixed build numbers for its commercial Java SE and GraalVM lines. Its risk matrix lists the affected versions; the fixed ones are in its patch notes.
php2shell last month was similar. Both bugs are in the language runtime rather than in application packages, so package-level scanners don't catch them. The response is also similar: find every runtime, check the conditions, upgrade and restart.
Frequently asked questions
What is Java4Shell?
+
Which Java versions are affected by Java4Shell?
+
Is my server affected if it runs on ARM or AWS Graviton?
+
How do I mitigate Java4Shell without upgrading?
+
Is Java4Shell being exploited in the wild?
+
Why didn't my SCA scanner flag Java4Shell?
+
Sources
- https://calif.io/java4shell/
- https://openjdk.org/groups/vulnerability/advisories/2026-11-17
- https://www.oracle.com/security-alerts/cspunov2026.html
- https://github.com/openjdk/jdk17u/commit/8ea73158afc9f2c62f72df68beb8723032bf695e
- https://github.com/openjdk/jdk17u/releases/tag/jdk-17.0.21.1-ga
- https://www.endorlabs.com/learn/java4shell-unauthenticated-rce-reported-in-openjdk-17-cve-2026-114938
- https://research.jfrog.com/post/java4shell-vulnerability/
- https://github.com/auth0/java-jwt/blob/master/lib/src/main/java/com/auth0/jwt/JWTDecoder.java
- https://github.com/kubernetes-sigs/node-feature-discovery/blob/master/docs/usage/features.md
- https://cloud.google.com/compute/docs/general-purpose-machines
- https://aws.amazon.com/ec2/instance-types/m6i/
- https://aws.amazon.com/ec2/instance-types/m7a/
- https://aws.amazon.com/ec2/instance-types/m5/
- https://attack.mitre.org/techniques/T1190/
- https://attack.mitre.org/techniques/T1203/
- https://attack.mitre.org/techniques/T1499/004/