How to Check and Patch Java4Shell (CVE-2026-114938)
Check whether your servers can trigger Java4Shell, find every Java runtime, update to the fixed builds, and switch off the bug today with one JVM option.
When you finish, you know which of your machines can trigger Java4Shell, every Java runtime on them is on a fixed build, and anything you could not update yet runs with the vulnerable code switched off.
Java4Shell, CVE-2026-114938, is a heap overflow in the fast Base64 decoder built into Java 17.0.6 and newer. A crafted Base64 string can crash the program, leak secrets from its memory, and, under the right conditions, run an attacker's code. Calif published its findings on November 17, 2026, the same day Oracle and the OpenJDK project shipped fixes, and CISA urged organizations to patch immediately. It needs three things at once: an affected Java version, a processor with AVX-512 VBMI, and an application that decodes Base64 an attacker controls. The steps check each one.
We tested the version checks, the package update, the changelog check, and the workaround option on Ubuntu 24.04 with OpenJDK 21 in November 2026, on an Intel processor without AVX-512. The other distributions, vendor builds, and container tags follow the vendors' own pages as of November 20, 2026.
Shell access with sudo or administrator rights to each server A list of the applications that run on Java For containers: access to rebuild and redeploy the images
Check whether the server's processor can trigger the bug
The bug sits in a fast Base64 decoder that Java only uses on x86-64 processors with the AVX-512 VBMI instructions. According to Red Hat's bulletin, those are Intel Xeon Ice Lake, Sapphire Rapids, Emerald Rapids, and Granite Rapids, and AMD processors from Zen 4 onward. ARM servers, including AWS Graviton and Apple silicon, never run that code.
On Linux, run the check from Calif's write-up, the researchers who reported the bug to Oracle:grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'The processor can trigger the bug only if all four names come back. On any system with Java 9 or newer, ask Java itself. On Linux and macOS:java -Xlog:os+cpu -version 2>&1 | grep -o avx512_vbmiOn Windows, in PowerShell:java -Xlog:os+cpu -version 2>&1 | Select-String avx512_vbmiNo output means Java found no AVX-512 VBMI on this machine. On a processor without AVX-512, such as Intel's 12th-generation Core laptop chips, the feature list Java prints shows avx and avx2 but no avx512 entries. On a virtual machine or cloud server, run the check inside the guest, because the host decides which processor features the guest sees.
Patch even when the check comes back empty. Containers and virtual machines move between hosts, and a cloud instance type can change underneath you. The check tells you how urgent the update is on this machine today.
Find every Java runtime on the machine
Most servers run more than one Java. Applications such as Jira, Confluence, and Keycloak ship their own runtime, and it does not show up as a system package. On Linux, list every java program on disk and every Java process running:sudo find / \( -path /proc -o -path /sys \) -prune -o -type f -path '*/bin/java' -print 2>/dev/null
ps -eo pid,args | grep '[j]ava 'Run each path the first command finds with -version added, for example /path/to/jre/bin/java -version. On Windows, search the program folders in PowerShell:Get-ChildItem 'C:\Program Files','C:\Program Files (x86)',"$env:LOCALAPPDATA\Programs","$env:LOCALAPPDATA\JetBrains" -Filter java.exe -Recurse -ErrorAction SilentlyContinue | ForEach-Object { $_.FullName; & $_.FullName -version }The search takes seconds and also finds the Java inside developer tools, including IDEs that JetBrains Toolbox installs in your user profile. JetBrains IDEs and Android Studio carry their own runtime in a jbr folder, and WebStorm 2025.1 ships Java 21.0.6 and PyCharm 2023.2 ships Java 17.0.7, both in the affected range. Update those tools through their own updater once the vendor ships a runtime on a fixed build. Until then, add -XX:-UseBASE64Intrinsics under Help > Edit Custom VM Options in JetBrains IDEs and Android Studio.
For Docker, check every running container:for c in $(docker ps -q); do docker inspect -f '{{.Name}}' "$c"; docker exec "$c" java -version; doneCompare each version with this list. Affected are Java 17 from 17.0.6, Java 21, Java 25, and Java 27, below these fixed builds:
17.0.21.1, 21.0.13.1, 25.0.5.1, and 27.0.1.1.
Java 18 to 20, 22 to 24, and 26 are affected too and get no fix, so move them to 25 or 27.
Java 8 and Java 11 are not affected, according to Red Hat, Ubuntu, and the Adoptium Temurin release notes. The one exception is Oracle's Java SE 8u511 Enterprise Performance Pack build, which Oracle lists as affected.
Read the fourth number. The fix shipped as an extra point release, so 21.0.13 is still vulnerable and 21.0.13.1 is fixed.
Patch the Java services that face the internet first
An affected Java and processor are not enough on their own. An attacker also has to get their own Base64 text into the decoder, and many services decode Base64 before anyone logs in, for HTTP Basic passwords, tokens, and uploads. Calif showed code execution without a login on Keycloak, Atlassian Jira and Confluence, JFrog Artifactory, Jenkins, and PingFederate, and after a login on Elasticsearch, Apache Kafka, Apache Solr, Gerrit, and Spinnaker, all in their default setups. Calif says these lists are not complete. It also showed that a Java program which opens a TLS connection to a malicious server can be attacked from that server. Patch in this order. First the services that answer the internet, then identity systems such as Keycloak and build servers such as Jenkins, then everything else. A reverse proxy in front is no fix. Calif found that nginx request buffering does not stop the attack, and after a WebSocket upgrade the data passes straight through. The trigger is only 65 characters of valid Base64, so size limits do not catch it. Blocking access from the internet lowers the risk until you patch, but only the update removes it.
Good to know: Keycloak's official container images show why the version number alone misleads. Keycloak 26.8.2-1 and 26.8.2-2 bundle an affected Java, and only the 26.8.2-3 image, also tagged 26.8.2, 26.8, and latest, carries the fixed one. Check the Java version inside the image, not the application version.
Update Java packages from your distribution and restart every Java service
On Debian and Ubuntu, update every installed OpenJDK package together:sudo apt update
sudo apt install --only-upgrade $(dpkg -l | awk '/^ii/ && /openjdk/ {print $2}')Then confirm the fix from the changelog the installed package put on disk. For OpenJDK 21:zgrep -c CVE-2026-114938 /usr/share/doc/openjdk-21-jre-headless/changelog.Debian.gzA number above 0 means the installed package carries the fix, and 0 means it does not. Use the package name for your version, such as openjdk-17-jre-headless.
The fixed packages, as of November 20, 2026, per the Ubuntu CVE page and the distributions' own trackers:
Ubuntu 24.04: openjdk-17 17.0.21.1+2-1~24.04.1, openjdk-21 21.0.13.1+2-1~24.04.1, openjdk-25 25.0.5.1+2-1~24.04.1. Ubuntu 22.04 and 26.04 have the same versions with their own suffix.
Debian 13: openjdk-21 21.0.13.1+2-1~deb13u1 and openjdk-25 25.0.5.1+2-1~deb13u1. Debian 12: openjdk-17 17.0.21.1+2-1~deb12u1.
Alpine 3.24: openjdk17 17.0.21.1_p2-r0, openjdk21 21.0.13.1_p2-r0, openjdk25 25.0.5.1_p2-r0.
RHEL 8, 9, and 10: Red Hat lists them as affected and its bulletin was still marked ongoing on November 20. Red Hat's OpenJDK 21.0.13.1 already ships inside the updated Keycloak images.
Restart every Java service after the update. A running Java program keeps the old code in memory until it restarts. Then confirm with ps -o pid,lstart,args -C java that each Java process started after the update.
Update vendor builds, bundled runtimes, and container images
If you installed Java from a vendor instead of your distribution, download its November build. Eclipse Temurin is fixed in 17.0.21.1+2, 21.0.13.1+2, 25.0.5.1+2, and 27.0.1.1+4. Amazon Corretto is fixed in 17.0.21.1.2, 21.0.13.1.2, 25.0.5.1.2, and 27.0.1.1.4. Microsoft's Build of OpenJDK is fixed in 17.0.21.1, 21.0.13.1, and 25.0.5.1. Azul says it has shipped a patch for Zulu and lists the builds on its Get Patched page.
For containers, pin the fixed build in the image tag, for example FROM eclipse-temurin:21.0.13.1_2-jre, then rebuild and recreate:docker build --pull -t myapp .
docker compose up -dThe --pull makes Docker fetch the patched base image instead of reusing the cached one, and up -d replaces the running container. That works when the compose file names the image with image: myapp. If it has a build: line instead, run docker compose build --pull and then docker compose up -d. A docker compose restart keeps the old container with its old Java, as the nginx patching guide shows.
For an application that bundles its own Java, install the vendor's update that ships the fixed runtime. If the vendor has none yet, apply the workaround in step 6 to that application.
If you cannot patch today, switch off the vulnerable decoder
Red Hat's bulletin and Calif both recommend one JVM option first. It turns off the hardware-accelerated Base64 code, so Java uses its plain decoder instead:-XX:-UseBASE64IntrinsicsIt is a standard product option and needs no unlock flag. To apply it to every Java program a service starts, set it as an environment variable. For a systemd service, run sudo systemctl edit yourservice and add:[Service]
Environment="JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics"Then restart the service. If the application has its own JVM options file, such as Jira's setenv.sh or a Keycloak JAVA_OPTS_APPEND setting, add the option there instead.
Check that it took effect. Java prints Picked up JAVA_TOOL_OPTIONS: -XX:-UseBASE64Intrinsics when it starts with the variable set, and this line shows the option as false, with {environment} as its source:JAVA_TOOL_OPTIONS=-XX:-UseBASE64Intrinsics java -XX:+PrintFlagsFinal -version | grep UseBASE64IntrinsicsFor a process that is already running, Red Hat's check is sudo -u SERVICEUSER jcmd PID VM.flags -all | grep -F UseBASE64Intrinsics, run as the user that owns the process. It needs the JDK, and it prints UseBASE64Intrinsics = false when the workaround is active.
Calif's alternative, -XX:UseAVX=2, turns off all AVX-512 use and slows more of the program. Set it only on x86-64 machines. On ARM, Java refuses to start with it. The workaround covers this bug only, so remove it once the fixed Java runs.
If a Java process still shows an old start time after the update, find the service that owns it with systemctl status PID and restart that service. If an application refuses to start after you set JAVA_TOOL_OPTIONS, check that the line has no stray quotes, then set the option in the application's own JVM options file instead.
If your vendor has not shipped a runtime update for a product that bundles Java, keep the workaround from step 6 in place and check the vendor's security advisories daily. When the fixed build arrives, remove the option, restart, and run the version check from step 2 once more.
Questions we get asked about this
Answers from experience, not a textbook.
The CVE was not in CISA's Known Exploited Vulnerabilities catalog on November 20, 2026. As of November 18, GreyNoise had seen exploitation attempts against its sensors without a confirmed success, according to Tenable. VulnCheck says it has a working code-execution exploit for its customers, and Calif is holding back its exploits for specific products until people have upgraded. Calif's short trigger that reproduces the memory corruption is public, and CISA has asked organizations to patch immediately.
They measure different things. Oracle's CVE record rates it 8.1 because exploitation is difficult, Red Hat rates it 9.8 Critical, and Calif gives 9.2 under the newer CVSS 4.0. All three treat it as serious, so the score does not change what to do.
Only if three things are true at once. The PC has an AMD Zen 4 or newer processor or another chip with AVX-512 VBMI, it runs Java 17 or newer, and a Java program on it decodes Base64 from someone else, for example from a server it connects to. Most Intel Core chips from the 12th generation on ship with AVX-512 switched off. Some 10th- and 11th-generation Core chips (Ice Lake, Tiger Lake, and Rocket Lake) have it, so run the check from step 1 either way. Update any Java 17 or newer on the PC anyway, including the runtime inside IDEs such as IntelliJ, PyCharm, and Android Studio, because the update is free and quick.
-XX:-UseBASE64Intrinsics only changes Base64 decoding and encoding, so programs that do little Base64 work see little difference. Red Hat and Calif give no figure for the slowdown. The UseAVX=2 alternative switches off AVX-512 for all code, so it costs more on servers that use those instructions heavily.
Only by name. Log4Shell in 2021 was a bug in the Log4j logging library, and updating Log4j fixed it. Java4Shell is a bug in the Java runtime itself, so updating Java fixes it, whichever libraries the application uses.