Attack scenariosJava vulnerability
Java4Shell (CVE-2026-114938): remote code execution in the OpenJDK Base64 decoder
Java4Shell (CVE-2026-114938) is a memory error in the Base64 decoder of OpenJDK 17, 21, 25 and 27. On an x86-64 server with AVX-512 VBMI, malformed Base64 can crash the JVM or run code, sometimes before any login. The fixed builds are 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Filter blocks the request shape on the way in, which buys time for that update and does not replace it.
What Java4Shell is
OpenJDK decodes Base64 in java.util.Base64.Decoder. On x86-64 CPUs with AVX-512 VBMI, HotSpot replaces that method with a hand-written intrinsic once the C2 compiler has seen it enough times. A process that has barely decoded Base64 is still on the Java implementation, which rejects bad input without the bad store. After warmup, the intrinsic handles the tail with a masked 64-byte store: one bit of the mask decides whether that output byte is written.
Padding is where the mask goes wrong. Each trailing = subtracts one from the computed output length. When the remaining tail is only padding, or a character and padding, the length steps from 0 to -1 or -2. The instruction that builds the mask from the length does not clear bits when that length is 64 or more. Read as an unsigned count, -1 and -2 are far past 64, so the mask stays all ones. The store then writes the whole vector, past the end of the buffer the decoder allocated. Java still throws IllegalArgumentException. The neighboring objects are already overwritten. The public write-up records the sizes. This page does not.
Those spilled bytes are mostly fixed values, not bytes the attacker picked. Reliable code execution means placing a chosen object under that spill, and the layout is different in every application. A crash, or a later read of the corrupted heap, is the nearer result. Datadog reproduced the write and describes the same limit: there is no single payload for every Java service. CISA asked organizations to patch on the day of disclosure, 17 November 2026. CVSS v4 scores it 9.2. A few reports call the same CVE Java2Shell.
The decoder is not an obscure API. HTTP Basic credentials, SAML artifacts, CSRF tokens and MIME encoded words are Base64, and applications often decode them before authentication. Any feature that passes an external Base64 string to the JDK decoder is in scope, including file uploads and tokens.
Which Java versions Java4Shell affects
The vulnerable intrinsic shipped in OpenJDK 17.0.6 and is present on the 17, 21, 25 and 27 lines until the security update of 17 November 2026. OpenJDK 8 and OpenJDK 11 do not contain this code. Oracle additionally lists one Java 8 performance build, 8u511b33-perf.
| Release line | Affected releases | First fixed build |
|---|---|---|
| Java 17 | 17.0.6 and later, before 17.0.21.1 | 17.0.21.1+4 |
| Java 21 | Every Java 21 before 21.0.13.1 | 21.0.13.1+4 |
| Java 25 | Every Java 25 before 25.0.5.1 | 25.0.5.1+4 |
| Java 27 | Every Java 27 before 27.0.1.1 | 27.0.1.1+4 |
The same source builds ship as Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine, Red Hat build of OpenJDK, Oracle Java SE and Oracle GraalVM for JDK. A vendor that backports the fix can keep the old version string, so confirm the build rather than trusting the number alone. java -version on one host misses runtimes bundled inside container images, appliances and products such as Keycloak, Jenkins and Elasticsearch.
Which CPUs Java4Shell needs
The hardware path is specific. ARM64 is not affected. x86-64 CPUs without AVX-512 VBMI are not affected, which means processors older than Intel Ice Lake and AMD Zen 4. On Linux, all four of these flags have to be present:
CPU flags
grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'
A missing flag means this bug does not apply to that machine. The JVM still needs to be a vulnerable build, and the application still needs to decode data the attacker supplied.
Java4Shell in Keycloak, Jenkins, Jira and Spring Boot
Calif reports code execution against default installations of Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate without a login, and against Kafka, Solr, Elasticsearch, Gerrit and Spinnaker after a login. The same write-up includes sample applications on Spring Boot and Apache Struts. The lists are what that research demonstrated, not a complete inventory. A separate case is a Java program that opens a TLS connection to a server the attacker controls. Filter in front of your own site does not see that client.
How to check a server
Work through the runtime, the CPU and the way the process was started.
- Run
java -versionfor every JVM, including the ones inside container images and the ones products ship privately. Compare the line with the table above. - Read the CPU flags. Without
avx512vbmithe vulnerable intrinsic is not selected. - Check the process command line for a workaround flag that is already in place, and for a JDK path that is not the one you just updated.
- Assume a hidden version is unfixed until the inventory says otherwise. Java does not put its runtime version in
X-Powered-Bythe way PHP does, so a banner scan will not answer this.
How to patch Java4Shell
Install one of the fixed builds in the table above and restart every process that loaded the old one. Rebuilding a container image does nothing until that workload is redeployed.
When the update cannot go out the same day, start the JVM with the flag that turns off the Base64 intrinsic. Other AVX-512 code stays enabled.
Preferred workaround
-XX:-UseBASE64Intrinsics
On x86-64 only, limiting the JVM to AVX2 also avoids the vulnerable path. Do not put this flag on ARM64. A native ARM64 JVM does not recognize it and will not start.
x86-64 only
-XX:UseAVX=2
Either flag has to be present at process start. Adding it to a running JVM does nothing.
Why there is no Java4Shell request here
Many servers are still unpatched, so this page does not publish a working request. The same bytes would be enough for someone scanning for an exposed host. The detection is described by what the request looks like to Filter, not by how to build one.
The virtual patch in Filter
Until the processes restart on a fixed build, the signature update is what stops these requests. Filter parses the request and matches it before the backend, so the JVM never decodes the value. The rules travel with the request signature set, which MLA refreshes automatically. They run on every host of Mikiri WAF and Mikiri WAAP. On Mikiri API Firewall they run on virtual hosts that have a loaded OpenAPI specification.
A Java4Shell request contains no shell command and no class name. The signal is illegal padding on a long Base64 token, which is what the two rules match. Both run after URL decoding, so a = written as %3D is visible. They look at the path, the query string, the body and the headers.
- A long Base64 token whose padding sits where a valid token of that length does not end. OpenJDK 17 reaches the fast path at a greater length than OpenJDK 21, 25 and 27.
- Padding past anything valid Base64 can end with, including after a run that is not a multiple of four.
The rules match that padding. They do not match Base64 as such. HTTP Basic credentials, SAML responses, JSON Web Tokens, PEM certificates and data URIs of ordinary length and ordinary padding stay through. A parameter name that is itself a long Base64 string and has an empty value can match. Ordinary forms do not look like that. An application that sends one can take an exception for that URL.
The signature is a temporary control. It sees requests that pass through Filter. It does not see Base64 that reaches a JVM by another path, it does not see a Java client connecting out, and it does not repair a host that was compromised before the rule was in place. The OpenJDK update is the fix.
What Mikiri WAAP adds once code has run
Request rules stop the attack on the way in. On Mikiri WAAP, Filter also inspects the response and can block it before it leaves. That matters after a successful exploit, or after a compromise that happened before the signature existed: command output, the contents of /etc/passwd and /etc/shadow, private keys, and the pages of known web shells.
Blocking the response does not undo a command that already ran, and it does not see a reverse shell that bypasses the application. Use it to contain the damage while the runtime is updated and the host is rebuilt. Response analysis is enabled per URL, as described in Response analysis. The response rules come from the same signature service.
What you see in WMC
A blocked request appears under the host in Attacks with the zone that matched (the path, the query, the body or a header), the rule and its description, and the mark that the request was blocked. A blocked response on Mikiri WAAP appears in the same list with blocking type 17.
Expected result, signature
- Response403 from Filter
- ZonePath, query, body or a header
- BackendRequest not forwarded
Expected result, response (Mikiri WAAP)
- ResponseFilter block page instead of the application page
- Blocking type17, blocked response
Check the signature on a test host
Use a test application behind Filter. Send a real HTTP Basic credential, a SAML token, or another valid Base64 value in the query, in a JSON field, and in Authorization. These rules leave it alone.
The value that matches the rules is not printed here, for the reason above. During an evaluation the same check is run on your own test host. To record a request without blocking it, switch the host or the URL to detection mode first.
Is Java4Shell the same as Log4Shell?
Java2Shell is another name for CVE-2026-114938. The versions, the CPU requirement and the fixed builds are the ones on this page.
Log4Shell is CVE-2021-44228, a lookup flaw in the Log4j library. A fixed OpenJDK build leaves a vulnerable Log4j in place. A fixed Log4j leaves this Base64 decoder in place. Each bug has its own update.
The same shape of problem, a flaw in the runtime that runs before the application can refuse the request, is PHP2Shell in PHP's form parser.
Check your Java applications
Deploy Mikiri on premises in front of the applications that decode Base64 and run the checks above on your own traffic. Evaluation is free, and application traffic stays on premises.
