Java4Shell explained: a Base64 bug in Java and what to do about it
Java4Shell explained: a Base64 bug in Java and what to do about it
18.11.2026
In short: A bug in the way OpenJDK decodes Base64 on certain x86-64 CPUs can corrupt memory and, according to the researchers who found it, lead to remote code execution in widely used products. Patches are available. If you run Java, update, and until you can, switch off the affected code path.
What is Java4Shell?
Java4Shell (CVE-2026-114938) is a memory-corruption bug in OpenJDK's hardware-accelerated Base64 decoder. On x86-64 CPUs with AVX-512 VBMI, OpenJDK decodes Base64 with a hand-written assembly routine. The bug sits in the code that handles the final few characters.
Researchers at Calif, who found the bug, rate it 9.2 (critical) under CVSS 4.0. Oracle rates it 8.1 (high) under CVSS 3.1.
How the bug works
Calif's example is a 65-character input: 64 "A" characters followed by a stray "=". For this input, OpenJDK allocates a 50-byte result array. The routine mishandles the "=" and calculates a negative output length. That turns into a full 64-byte write, which runs 62 bytes past the end of the array.
Java rejects the input afterwards, but by then neighbouring objects may already be corrupted. Older OpenJDK 17 builds need 128 "A" characters before the "=".
The bug only affects the hardware-accelerated decoder. It is used on x86-64 processors that support AVX-512 VBMI, for example Intel Xeon from Ice Lake and AMD Zen 4 or newer.
Why it is dangerous
Base64 decoding is common in authentication, file uploads and network communication. Calif reports working remote code execution against several widely used products in their default configuration:
- Without authentication: Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins, PingFederate
- With authentication: Apache Kafka, Apache Solr, Elasticsearch, Gerrit, Spinnaker
There is no universal exploit. An attacker needs an application-specific way to get malicious Base64 data to the decoder. Calif has published a proof of concept for the memory corruption itself, but not the exploits against these products. Depending on the target, the bug can be used to read sensitive memory or to execute code.
Who is affected?
OpenJDK 17.0.6 and later are reported as affected, including distributions built from that code:
- Oracle Java SE
- Amazon Corretto
- Eclipse Temurin
- Microsoft Build of OpenJDK
- Azul Zulu
- Red Hat OpenJDK
As of the reports from 17 November, no exploitation in the wild has been publicly confirmed.
How to protect your servers
1. Update Java. Oracle released patches on 17 November as part of its November Critical Security Patch Update. Its replacement builds are 8u513, 11.0.33.1, 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Which of these lines are affected by this specific bug is not confirmed for every version. Other distributions use their own version numbers, so take the fixed build from your vendor's advisory and not from Oracle's numbering.
2. Check your CPU.
grep -o avx512vbmi /proc/cpuinfo
No output means the CPU lacks the feature that the vulnerable code path needs. In VMs and containers, check where the JVM actually runs.
3. Mitigate until you can patch. Start the JVM with:
-XX:-UseBASE64Intrinsics
This disables the hardware-accelerated Base64 routines. On x86-64 systems, -XX:UseAVX=2 is an alternative that disables AVX-512. Both are temporary mitigations.
4. Restart and verify. Restart your applications after updating and confirm the running build, since the installed package version alone does not prove the fix is live. Look through your logs for crashes and unusual requests.
What happened at Darkstone
Our REST API runs on Java, so we took it offline as a precaution and brought it back with a patched Java runtime in both regions. It was unavailable for about 40 minutes.
Network Security found that none of our production servers have the CPU feature Java4Shell needs, and found no evidence of exploitation against our platform. Updates for our remaining components are being rolled out.
Want to be alerted when it happens?
Events like this do not wait for office hours. With the Darkstone Advanced Security Program, coming soon, you get alerts for events like this directly on your phone. You can also give Network Security an intervention approval, so we can act on your services right away.
Interested? Write to security@darkstone.de, and we will get back to you as soon as the program launches.