How to fix Java4Shell (CVE-2026-114938) in Java 17, 21, 25 and 27
Written by our founder, a cybersecurity architect · Updated
Short answer
Update Java. Java4Shell (CVE-2026-114938) is a memory corruption bug in the fast Base64 decoder of OpenJDK, the code behind java.util.Base64. Crafted Base64 text makes the JVM write past the end of a buffer, and the researchers who found it reached remote code execution without signing in on Jenkins, Jira, Confluence and Keycloak. Oracle and OpenJDK fixed it on 17 November 2026.
It affects Java 17 (from 17.0.6), 21, 25 and 27 on x86-64 servers whose processor supports AVX-512 VBMI, which includes many recent Intel Xeon and AMD EPYC cloud servers. Java 8 and 11 are not affected, except Oracle’s Java 8 Enterprise Performance Pack, and ARM servers such as AWS Graviton are not affected.
If your Java vendor hasn’t shipped a fixed build yet, start Java with -XX:-UseBASE64Intrinsics today. It turns off the vulnerable code at a small cost in speed.
Am I affected?
Three things have to be true at once:
- You run Java 17.0.6 or newer, 21, 25 or 27, from any vendor: Oracle, Eclipse Temurin, Amazon Corretto, Azul Zulu, Microsoft, Red Hat, BellSoft, SAP or GraalVM.
- It runs on an x86-64 processor with AVX-512 VBMI, such as Intel Xeon Ice Lake, Sapphire Rapids or newer, or AMD Zen 4 or newer. Many cloud servers use these.
- Your app decodes Base64 that someone else controls. That is very common: login tokens, HTTP basic authentication, file uploads, SAML and JSON payloads all carry Base64.
Apps written in Java or Kotlin, such as Spring Boot, are concerned, and so is any Java software you host yourself: Jenkins, Jira, Confluence, Keycloak, Artifactory, Kafka, Solr or Elasticsearch. A web app built with Lovable, Bolt or Next.js runs no Java of yours, unless you added one of these yourself.
How do I check?
Run these where the app actually runs, on each server or inside each container, not only on your laptop:
java -version
grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'If the second command prints all four flags, the processor can run the vulnerable code. If it prints fewer, or if the server is ARM, this bug can’t be reached, but update anyway: the same release fixes nine other Java vulnerabilities.
For a container, run the same commands inside it, for example with docker run --rm your-image java -version. The processor is the host’s, so a container on an AVX-512 host is exposed even if it worked fine on your laptop.
How do I update?
- Install a build released on or after 17 November 2026. Oracle’s fixed versions are 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1; Amazon Corretto’s are 17.0.21.1.2, 21.0.13.1.2, 25.0.5.1.2 and 27.0.1.1.4; Eclipse Temurin’s are 17.0.21.1+2, 21.0.13.1+2, 25.0.5.1+2 and 27.0.1.1+4. Other vendors publish their own; check their release page.
- In a Dockerfile, pin a fixed image tag once your vendor publishes it, rebuild and redeploy. A tag like
eclipse-temurin:21only picks up the fix when the image is rebuilt after the fixed release. - Update the Java software you host as well. Jenkins, Jira, Keycloak and others often ship their own Java in their container images, so pull their fixed images.
- Restart every Java process and run
java -versionagain on the running server.
Eclipse Temurin published its fixed builds on 18 November 2026. On 20 November 2026 the official eclipse-temurin Docker images didn’t include them yet, so if you build on those images, apply the workaround below until a fixed tag appears.
What if I can’t update today?
Turn off the vulnerable code with a startup option. The researchers who found the bug give two; the first is enough and works on any processor:
-XX:-UseBASE64IntrinsicsThe second, -XX:UseAVX=2, turns off AVX-512 entirely and slows down more than Base64. Use it only on x86-64: Java on ARM refuses to start with it. Neither option appears in Oracle’s or OpenJDK’s advisories, so treat them as a stopgap until you update.
The easiest way to add the option to every Java process, including ones started by scripts you don’t control, is the JAVA_TOOL_OPTIONS environment variable:
ENV JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics"Then check that the running JVM picked it up:
java -XX:+PrintFlagsFinal -version | grep UseBASE64IntrinsicsThe line should end with false.
Is Java4Shell being exploited?
As of 18 November 2026, no attacks had been reported and CISA hadn’t added it to its catalog of exploited vulnerabilities. The researchers published a proof of concept that only shows whether a Java build and processor reproduce the bug, and are keeping their exploits for specific products private for now. Other researchers say they have built working exploits, so expect that to change quickly: Node2Shell went from proof of concept to attacks in four days.
Can a security scanner tell me if I’m affected?
Only a check that sees the Java version and processor your app runs on, such as a scan of your servers or container images, or the two commands above. A scan of your website from the outside can’t see them, and neither can a scan of your dependencies, because Java itself isn’t a package in your lockfile.
Afterprompt doesn’t detect Java4Shell. While you patch, our free scan checks what anyone can see from the outside, like API keys in your JavaScript and files left public, and our code scan checks the packages in your lockfiles for known vulnerabilities on every push, for free. On Pro, those packages are also checked every week against newly published vulnerabilities, with an email when one affects you.
Sources
Checklist
- Run
java -versionon every server and container - Check the processor for the avx512vbmi flag
- Update to a build from 17 November 2026 or later
- Pull fixed images of Jenkins, Jira, Keycloak or other Java software you host
- Until then, start Java with
-XX:-UseBASE64Intrinsics - Restart every Java process and check again
Scan your site for free
Leaked API keys, exposed files and missing security headers, with a fix for each. No account, about a minute.
Questions
- What is Java4Shell?
- The name given to CVE-2026-114938, a bug in the fast Base64 decoder built into OpenJDK. Crafted Base64 text makes Java write past the end of a buffer, which can let an attacker run code on the server without signing in.
- Is Java 8 or Java 11 affected by Java4Shell?
- No, standard Java 8 and 11 are not affected. The exception is Oracle’s Java 8 Enterprise Performance Pack, fixed in 8u513-perf.
- Is Spring Boot affected by Java4Shell?
- Spring Boot itself has no bug, but it runs on the JVM, so a Spring Boot app on Java 17, 21, 25 or 27 on an AVX-512 server is exposed if it decodes Base64 from requests. Update the Java runtime under it.
- Are ARM servers affected?
- No. The vulnerable code only exists on x86-64 processors with AVX-512 VBMI, so ARM servers such as AWS Graviton and Apple Silicon machines can’t reach it.
- Is Java4Shell the same as Log4Shell or Text4Shell?
- No. Log4Shell (2021) was in the Log4j library and Text4Shell (2022) in Apache Commons Text. Java4Shell is in the Java runtime itself, so updating your libraries doesn’t fix it: you update Java.