Java4Shell: OpenJDK Base64 RCE (CVE-2026-114938)
Java4Shell is a heap overflow in OpenJDK's AVX-512 Base64 decoder that can lead to remote code execution. Fixed in 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1.
TL;DR
- Java4Shell is a heap overflow in OpenJDK's AVX-512 Base64 decoder. A malformed padded tail makes the decoder write 62 bytes past a 50-byte output array. Calif disclosed it on 2026-11-17.
- Any OpenJDK 17.0.6 or later on the 17 line, or any 21, 25 or 27 build, is affected on an x86-64 CPU with AVX-512 VBMI. Java 11 and standard Java 8 are not affected.
- Oracle rates it CVSS v3.1 8.1 High, while Calif rates it CVSS v4.0 9.2 Critical. No exploitation in the wild has been reported, and it is not in CISA KEV as of November 18, 2026.
- Upgrade to 17.0.21.1, 21.0.13.1, 25.0.5.1 or 27.0.1.1. If you cannot upgrade, disable the Base64 intrinsic; see "How do I fix it?" for the flags and their limits.
Am I affected?
You are exposed when all of these conditions hold:
- You run an affected OpenJDK build, or a downstream build made from it: 17.0.6 or later on the 17 line, or any 21, 25 or 27 build.
- The host CPU is x86-64 and reports AVX-512F, AVX-512BW, AVX-512 VBMI and BMI2.
- The JVM has not been started with
-XX:UseAVX=2or a lower AVX level. - The application passes attacker-controlled bytes to
java.util.Base64.Decoder, and that decoder has been compiled by the JIT.
Java 11 and standard Java 8 do not contain the AVX-512 decoder. Oracle lists its Java SE 8 Performance Pack build 8u511b33-perf as affected. ARM64 hosts are not affected, even when they run the same Java build.
The vulnerable path is selected automatically by the JVM when the CPU supports the instructions. A container image can therefore be exposed on one host and safe on another. The same is true for a virtual machine that is migrated between CPU generations.
| Branch | Affected versions | Fixed version |
|---|---|---|
| OpenJDK 17 | 17.0.6 through 17.0.21.0.3 | 17.0.21.1 |
| OpenJDK 21 | All 21 releases through 21.0.13.0.3 | 21.0.13.1 |
| OpenJDK 25 | All 25 releases through 25.0.5.0.3 | 25.0.5.1 |
| OpenJDK 27 | All 27 releases through 27.0.1.0.3 | 27.0.1.1 |
Check the runtime that your application actually uses, not only the one on your build machine:
java -version
readlink -f "$(command -v java)"
Then check the CPU flags on the host or virtual machine:
grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'
All four flags must appear in the output. The affected CPU families include:
- Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids.
- AMD EPYC and Ryzen parts from Zen 4 onward.
For a running JVM, check the flags it received with jcmd <pid> VM.flags and look for UseAVX or UseBASE64Intrinsics.
How do I fix it?
Upgrade to a fixed JDK build. The OpenJDK project released the fix on 2026-11-17 in the 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1 update builds. Oracle's fixed Java SE builds for those branches use the same version numbers.
- Upgrade the runtime for every Java process, including runtimes bundled inside application servers, build tools and appliances. Amazon Corretto's fixed builds are 17.0.21.1.2, 21.0.13.1.2, 25.0.5.1.2 and 27.0.1.1.4. Azul's fixed Zulu builds are 17.70.201, 21.54.201, 25.38.201 and 27.30.201.
- On Debian or Ubuntu, install the updated package for the branch you run:
bash sudo apt update sudo apt install --only-upgrade openjdk-17-jdk openjdk-21-jdk openjdk-25-jdk - On RHEL, Fedora or Amazon Linux, update the OpenJDK or Corretto package for the branch you run:
bash sudo dnf update java-17-openjdk java-21-openjdk java-25-openjdk sudo dnf update java-17-amazon-corretto-devel java-21-amazon-corretto-devel java-25-amazon-corretto-devel - In containers, pull or rebuild from an updated base image and recreate the container. A new image alone does not change the running process. Check the result inside the container with
docker exec <container> java -version. - Restart every Java service after the upgrade. A long-running JVM keeps the old runtime in memory until it restarts.
Red Hat had not published fixed OpenJDK packages when its bulletin was last updated on 2026-11-17. Its builds on RHEL 8, 9 and 10, and its OpenJDK 17, 21 and 25 builds, remain affected. Use the workaround on those systems until errata arrive.
If you cannot upgrade, start each JVM with one of these flags and remove it after the update:
-XX:-UseBASE64Intrinsicsdisables the hardware-accelerated Base64 encoder and decoder. It removes the vulnerable path and leaves other AVX-512 optimizations in place. Upwind's lab found that it stopped the overflow on every affected version it tested.-XX:UseAVX=2disables AVX-512 entirely. Use it only on x86-64 hosts, because JVMs on ARM64 do not recognize it and fail to start.- Do not use
-XX:DisableIntrinsic=_base64_decodeBlockon its own. Upwind reports that the JVM fails to start with that flag by itself.
A proxy that buffers complete request bodies, such as nginx with its default settings, blocks some exploit chains. It does not block all of them. Calif's Elasticsearch chain works from a single complete request, and WebSocket frames bypass request-body buffering after a WebSocket upgrade. A web application firewall is not a complete mitigation either, because the vulnerable decoder is reachable from many application paths.
What is the root cause?
OpenJDK's Base64 decoder is normally Java code, but HotSpot replaces its inner loop with a hand-written x86-64 stub when the CPU supports AVX-512 VBMI. The stub decodes 256-byte blocks, then 64-byte blocks, then a final tail of 1 to 63 bytes. The bug is in the tail calculation: it derives the output length from the input length without first checking that the tail contains a complete four-character group.
The code is in src/hotspot/cpu/x86/stubGenerator_x86_64.cpp, in StubGenerator::generate_base64_decodeBlock(), at lines 6177 to 6202 of the 17.0.21.0.3 tag:
__ BIND(L_finalBit);
// Now have 1 to 63 bytes left to decode
__ movl(output_size, length);
__ shrl(output_size, 2); // Find (len / 4) * 3 (output length)
__ lea(output_size, Address(output_size, output_size, Address::times_2, 0));
// Strip pad characters, if any, and adjust length and mask
__ addq(length, start_offset);
__ cmpb(Address(source, length, Address::times_1, -1), '=');
__ jcc(Assembler::equal, L_padding);
__ BIND(L_donePadding);
__ subq(length, start_offset);
__ movq(output_mask, -1);
__ bzhiq(output_mask, output_mask, output_size);
The padding block then subtracts one from output_size for each =:
__ BIND(L_padding);
__ decrementq(output_size, 1);
__ shrq(rax, 1);
For a tail of one to three bytes, (length / 4) * 3 is zero. One padding byte makes output_size equal to -1. The bzhiq instruction copies the low bits of its source up to the index, but an index of 64 or more leaves the source unchanged. With a source of -1, all 64 bits of the output mask are 1. The later evmovdqub treats every bit as a byte to store, so it writes 64 bytes from the destination pointer.
Java calculates the output array size separately as (ceil(input_length / 4) * 3) - padding. For the 65-byte input 64 * "A" + "=", that is (17 * 3) - 1, or 50 bytes. The stub decodes the first 64 characters into 48 bytes. It then writes 64 bytes starting at offset 48: two bytes inside the array and 62 bytes past it. Java rejects the input with IllegalArgumentException afterwards, but the store has already happened.
How is it exploited?
The attack needs an application that decodes attacker-controlled Base64 and a JVM that has compiled the decoder.
- The attacker sends malformed Base64 whose final group is one to three bytes and ends in
=. On the newer builds,64 * "A" + "="is enough. On JDK 17 builds, the AVX-512 path starts at 129 bytes, so the trigger is128 * "A" + "=". - The JVM's C2 compiler must have selected the intrinsic. Busy services reach that state after repeated decodes; Calif's proof of concept warms the decoder with 200,000 valid decodes before sending the malformed input.
- The stub decodes the complete 64-byte blocks, then enters the tail path. The output length underflows to -1, the mask becomes all ones, and the 64-byte store overruns the output array.
- Java throws
IllegalArgumentException. The attacker ignores the error. The heap now contains a fixed-value overwrite at a location the attacker can influence through heap grooming. - Calif turns the fixed write into a chosen-value write by arranging for the overflow to land on a neighboring array's length field. The enlarged array becomes a writer. A second corrupted array becomes a reader that copies heap bytes back into a response, a leak the researchers call JavaBleed.
- With a writer, a reader and heap repair, the chain reaches arbitrary writes and then the JVM's code cache or hooks. That is enough for code execution in the Java process.
- The exact layout and timing differ per application. Calif says there is no universal exploit, and some chains depend on network round-trip time and partial request delivery.
The public proof of concept is a bounded trigger, not a working exploit. It decodes 64 * "A" + "=" into a 4096-byte array and checks that 62 bytes past offset 50 were overwritten. Calif's Quang Luong found the bug with AI assistance in about an hour and built a working exploit two hours later, at a token cost under $200. The product-specific chains are withheld.
byte[] malformed = ("A".repeat(64) + "=").getBytes(StandardCharsets.US_ASCII);
byte[] target = new byte[4096];
decoder.decode(malformed, target);
How does the attack flow?
The chain starts with a padded Base64 tail that is shorter than one four-character group and ends in a 64-byte masked store that runs past the output array.
C2-compiled intrinsic"] B --> C["Padded tail of 1 to 3 bytes
no length check"] C --> D["output_size underflows to -1
mask becomes all ones"] D --> E["64-byte store from offset 48
62 bytes past a 50-byte array"] E --> F["Heap corruption and JavaBleed
array lengths overwritten"] F --> G["Arbitrary write and code execution"]
What can an attacker do?
An attacker can crash the JVM, leak heap memory, or execute code in the Java process, depending on the application and the heap layout. The code-execution path needs all of the following conditions:
- An affected JDK on an x86-64 CPU with AVX-512 VBMI.
- Attacker-controlled Base64 that reaches
java.util.Base64.Decoderbefore the application validates it. - A decoder compiled by the JIT, which a busy service reaches without special configuration.
- A heap layout and request timing that let the fixed overwrite corrupt a useful object.
- Enough requests to groom the heap and to retry after a failed attempt.
Calif demonstrated pre-authentication code execution in default configurations of these products:
- Keycloak
- Atlassian Jira
- Atlassian Confluence
- JFrog Artifactory
- Jenkins
- PingFederate
It demonstrated code execution after login in these products:
- Apache Kafka Broker
- Apache Solr
- Elasticsearch
- Gerrit
- Spinnaker
It also demonstrated code execution in sample Spring Boot and Apache Struts applications. Those lists are not exhaustive, and each product needs its own chain.
The same technique can read heap memory that may contain tokens, keys and personal data before any code execution. Upwind reproduced a crash on an AWS Ice Lake instance. The overflow corrupted the next object in memory in 97% of rounds and eventually crashed the JVM. Blackpoint Cyber's Adversary Pursuit Group crashed a test Spring Boot application with about 28,300 malformed login requests over roughly 20 seconds, without logging in. In separate local testing, Blackpoint reproduced Calif's heap-disclosure technique, without reproducing remote memory disclosure or code execution.
A Java program that opens a TLS connection to a malicious server can also be compromised, even when it exposes no service of its own. Calif says it received that client-side exploit from samczsun and has not published how it reaches the decoder.
Why does the fix work?
The fix adds a length check before the tail path. A tail shorter than one complete four-character group now goes to the scalar loop instead of the vector store. The changed code is in commit 5177a70b385c and in the 17u, 21u, 25u and 27u update tags:
@@ -3395,6 +3395,10 @@ address StubGenerator::generate_base64_decodeBlock() {
__ 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 fragment
L_bruteForce decodes only complete four-byte groups. It leaves the incomplete tail to the Java code, which rejects the input before the vector store runs. The guard covers the only path in the AVX-512 stub that computes the output mask from a short tail. The same four lines are in the 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1 source trees. The fix does not change the decoder's behavior for valid input.
How do I check if I was compromised?
No exploitation in the wild has been reported, and no indicators of compromise have been published. These checks find malformed input and crashes that could be attempts, not proof of compromise.
- Look for malformed Basic credentials in web server logs. A valid Basic token is Base64 and its length is a multiple of four. A token ending in
=with a length that is not a multiple of four is a lead:bash grep -RnoE 'Basic [A-Za-z0-9+/]{32,}={0,2}' /var/log/nginx /var/log/apache2 2>/dev/null | awk -F: '{v=$NF; if (length(v) % 4 != 0 && v ~ /=$/) print $0}' - Look for bursts of
IllegalArgumentExceptionfrom the Base64 decoder in application logs:bash grep -R "IllegalArgumentException" /var/log/<application> 2>/dev/null | grep -i "base64" - List recent JVM crash logs and check their stack for the Base64 stub:
bash find / -name 'hs_err_pid*.log' -mtime -14 2>/dev/null grep -i -E 'base64|decodeBlock' /path/to/hs_err_pid*.log - Check for unexpected restarts or JVM process churn around the same time. A crash from this bug can look like an out-of-memory kill or a normal service restart in a supervisor log.
A malformed token in a log can come from a legitimate broken client. Treat a hit as a reason to inspect the source address, the request path and the surrounding requests. An attempt that fails before the store can also leave no trace beyond the rejected request.
Timeline
The public record runs from a proposed fix in September to the fixed builds in November.
- 2026-09-09: A public OpenJDK pull request describes the short padded tail overflow and proposes the same length check. It is closed without merging on 2026-11-04.
- 2026-10-22: The CVE ID is reserved.
- 2026-11-17: OpenJDK publishes its advisory and Oracle ships the fixed
.1builds. Calif publishes its write-up and bounded proof of concept. CISA and the Canadian Centre for Cyber Security publish alerts. - 2026-11-18: No exploitation in the wild is publicly reported, and the CVE is not in CISA KEV.
FAQ
Is Java 8 or Java 11 affected? No. Standard Java 8 and Java 11 do not contain the AVX-512 Base64 decoder. Oracle lists only its Java SE 8 Performance Pack build 8u511b33-perf as affected on the 8 line.
Is my ARM64 server affected? No. The vulnerable stub is x86-64 code that uses AVX-512 VBMI instructions. An ARM64 JVM does not run it, even when it runs an affected Java version.
Is there a working public exploit? No working end-to-end exploit has been published. Calif published a safe trigger and withheld its product chains. Wiz says it built a proof-of-concept exploit and proved remote exploitation against Jenkins, Confluence and Tomcat, while Upwind reports crashes and Blackpoint reports a local heap leak and a crash on a test Spring Boot application.
Was Java4Shell exploited in the wild? No public report shows exploitation as of November 18, 2026. The CVE is not in CISA KEV, and Canada's Cyber Centre said it was not aware of active exploitation when it published its alert on 2026-11-17.
Do I need to update the application or only the JDK? Update the JDK that the application actually runs on, including a runtime bundled inside the application or its container. Some products also need their own update to replace the bundled runtime.
Does a WAF or nginx request buffering stop the attack? Not reliably. Request buffering breaks some chains, and a WAF may block some payloads, but the vulnerable decoder is reachable from many application paths. Patching the runtime removes the bug; the flags are a workaround that leaves the vulnerable stub unpatched in the JDK.
References
- Calif, "Java4Shell: Write once, RCE everywhere" (checked November 18, 2026): https://calif.io/java4shell
- OpenJDK Vulnerability Advisory, 2026-11-17 (checked November 18, 2026): https://openjdk.org/groups/vulnerability/advisories/2026-11-17
- Oracle Critical Security Patch Update, November 2026 (checked November 18, 2026): https://www.oracle.com/security-alerts/cspunov2026.html
- CVE-2026-114938 record (checked November 18, 2026): https://www.cve.org/CVERecord?id=CVE-2026-114938
- OpenJDK fix commit 5177a70b385c (checked November 18, 2026): https://github.com/openjdk/jdk/commit/5177a70b385c16f26ede191fdac7aaba0bed0f8b
- OpenJDK pull request 32781, "AVX-512 Base64 decoder overwrites output buffer on short padded tail" (checked November 18, 2026): https://github.com/openjdk/jdk/pull/32781
- Vulnerable source at jdk-17.0.21.0.3, StubGenerator::generate_base64_decodeBlock (checked November 18, 2026): https://github.com/openjdk/jdk17u/blob/jdk-17.0.21.0.3-ga/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp
- Fixed source at jdk-17.0.21.1 (checked November 18, 2026): https://github.com/openjdk/jdk17u/blob/jdk-17.0.21.1-ga/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp
- Oracle JDK 17.0.21.1 release notes (checked November 18, 2026): https://www.oracle.com/java/technologies/javase/17-0-21-1-relnotes.html
- Oracle JDK 21.0.13.1 release notes (checked November 18, 2026): https://www.oracle.com/java/technologies/javase/21-0-13-1-relnotes.html
- Oracle JDK 25.0.5.1 release notes (checked November 18, 2026): https://www.oracle.com/java/technologies/javase/25-0-5-1-relnotes.html
- Oracle JDK 27.0.1.1 release notes (checked November 18, 2026): https://www.oracle.com/java/technologies/javase/27-0-1-1-relnotes.html
- Amazon Corretto 17.0.21.1.2 release (checked November 18, 2026): https://github.com/corretto/corretto-17/releases/tag/17.0.21.1.2
- Amazon Corretto 21.0.13.1.2 release (checked November 18, 2026): https://github.com/corretto/corretto-21/releases/tag/21.0.13.1.2
- Amazon Corretto 25.0.5.1.2 release (checked November 18, 2026): https://github.com/corretto/corretto-25/releases/tag/25.0.5.1.2
- Amazon Corretto 27.0.1.1.4 release (checked November 18, 2026): https://github.com/corretto/corretto-27/releases/tag/27.0.1.1.4
- Azul Zulu November 2026 release notes (checked November 18, 2026): https://docs.azul.com/core/pdfs/november-2026/azul-zulu-ca-release-notes-november-2026-rev1.0.pdf
- Red Hat security bulletin RHSB-2026-018 (checked November 18, 2026): https://access.redhat.com/security/vulnerabilities/RHSB-2026-018
- CISA alert, "Critical Java Vulnerability Requires Immediate Patching" (checked November 18, 2026): https://www.cisa.gov/news-events/alerts/2026/11/17/critical-java-vulnerability-requires-immediate-patching
- CISA Known Exploited Vulnerabilities catalog (checked November 18, 2026): https://www.cisa.gov/known-exploited-vulnerabilities-catalog
- Canadian Centre for Cyber Security alert AL26-029 (checked November 18, 2026): https://www.cyber.gc.ca/en/alerts-advisories/al26-029-critical-vulnerability-impacting-oracle-java-cve-2026-114938
- Upwind, "Java4Shell: What We Know Now and What Comes Next" (checked November 18, 2026): https://www.upwind.io/blog/java4shell-what-we-know-now-and-what-comes-next
- Wiz, "CVE-2026-114938 OpenJDK RCE (Java4Shell)" (checked November 18, 2026): https://www.wiz.io/blog/cve-2026-114938-rce-java4shell-openjdk
-
The Hacker News, "Critical Java4Shell Flaw (CVE-2026-114938) Enables Pre-Auth RCE in Jira, Jenkins, Keycloak and More" (checked November 18, 2026): https://thehackernews.com/2026/11/java4shell-cve-2026-114938-enables-pre.html
-
Blackpoint Cyber, "Java4Shell (CVE-2026-114938): Inside a Critical Flaw in Java’s Base64 Decoder" (2026-11-17; checked 2026-11-18): https://blackpointcyber.com/blog/java4shell-cve-2026-114938-java-base64-decoder-flaw/