How to Check If Your Java Is Vulnerable to Java4Shell

How to Check If Your Java Is Vulnerable to Java4Shell — and Patch It

If you run a Java application on a server, I need you to do two things today. First, check whether your JDK is affected by the newly disclosed Java4Shell bug. Second, if it is, disable the dangerous code path until you can roll out the fix. This is not a drill: the same team that disclosed PHP2Shell last year has now found a remote-code-execution hole in java.util.Base64 that ships inside the world’s most popular Java runtime.

Source code with syntax highlighting on a developer's dark-themed monitor.
Image: Martin Vorel (Bloxgros) via Wikimedia Commons (CC BY-SA 4.0)

The short story: researchers found a memory-corruption bug in OpenJDK’s hand-optimized Base64 decoder. A remote attacker who can send a specially crafted Base64 string to a Java service can overflow a heap buffer and, in many default-configured products, run code without logging in first. Yes, this is the kind of bug that should have stayed buried inside a performance shortcut.

What Java4Shell actually is

The vulnerability, tracked as CVE-2026-114938, sits inside HotSpot’s x86-64 Base64 decoding intrinsic. To make Base64 decode fast, OpenJDK compiles the decode path into hand-rolled assembly that uses AVX-512 VBMI CPU instructions. That assembly handles the trailing “=” padding characters with a mask calculation. The bug: when the input ends in a short padding tail, the length calculation underflows, the mask ends up all-ones, and the decoder writes past the end of the output buffer. In Calif’s words, that turns into roughly a 62-byte heap overflow. On a recent CPU, a remote attacker with a short Base64 string gets a memory write they can chain into code execution.

Calif’s write-up gives the flaw a CVSS 4.0 score of 9.2/10 (Critical); Oracle’s own CVSS v3.1 rating is 8.1 (High). CISA is urging organisations to patch immediately and has flagged memory-corruption flaws of this kind as a critical risk.

Who is affected, in plain terms

Not every Java installation is in the firing line. Three gates must line up:

  • Software: OpenJDK 17.0.6 and newer, plus the downstream distributions built on that code. Oracle’s risk matrix marks the affected Java SE builds as 17.0.21.0.3, 21.0.13.0.3, 25.0.5.0.3, and 27.0.1.0.3. Standard Java 8 and 11 builds are not in scope.
  • Hardware: an x86-64 CPU with AVX-512 VBMI support. ARM64 is not affected. Intel Xeon Ice Lake and newer servers, AMD EPYC and Ryzen Zen 4 and newer, all qualify.
  • Trigger: the service must decode Base64 input that an attacker controls, which is trivially true for any service that accepts logins, file uploads, or network messages that later get base64-decoded.

Products Calif demonstrated as affected include Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins, and PingFederate (pre-auth RCE, default configs), plus Apache Kafka, Solr, Elasticsearch, Gerrit, and Spinnaker (post-auth) with a client-side exploit also possible when a Java program opens a TLS connection to a malicious server.

Step 1 — Confirm your CPU is even at risk

This bug only runs on CPUs that expose AVX-512 VBMI. If your host lacks those instructions, you cannot be exploited by this path and you can stop reading here. On Linux, run:

grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'

You should see all four flags. If any of them is missing, your JVM is running the safe, fallback decode path.

Step 2 — Check your Java version

If your CPU passes the flag test, compare your runtime version against the affected range:

java -version

OpenJDK 17.0.6 and newer is affected. Oracle Java SE 8 is not in scope for the standard builds, but assume every build from 17.0.6 up is affected until you confirm your vendor build is on the fixed list. If you cannot tell what distribution you run, run java -XshowSettings:vm -version and look for the vendor name at the bottom.

Step 3 — Harden immediately while you upgrade

If you cannot patch yet, you can disable the accelerated Base64 decoder with a JVM flag. This stops the vulnerable code path with no recompilation. On affected x86-64 hosts, start the JVM with either:

java -XX:+UnlockDiagnosticVMOptions -XX:-UseBASE64Intrinsics -jar app.jar

or, on the same hardware:

java -XX:UseAVX=2 -jar app.jar

The second flag also disables AVX-512, so it is safe here. Do not use -XX:UseAVX=2 on ARM64 JVMs: they do not understand it and will refuse to start. These are stopping measures, not fixes; keep pushing the update.

Step 4 — Apply the patch

OpenJDK and the vendors shipped fixes on the same day as the disclosure. The guidance is simple: identify every JDK and Java runtime in your estate, then update. Concretely:

  • Oracle JDK: roll to 17.0.21.1 or later. Oracle also lists 21.0.13.1, 25.0.5.1, and 27.0.1.1 as fixed builds on their side of the ledger.
  • Amazon Corretto: fixed builds are out for Java 17, 21, 25, and 27.
  • Cloud or distro packages: the same fixed builds have been pushed to the builds of Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine, Red Hat OpenJDK, and Oracle OpenJDK.

Check your vendor’s release notes or the OpenJDK vulnerability advisory page for the exact fixed build numbers rather than assuming. Also confirm your product’s patched version, because applications such as Jenkins, Confluence, or Artifactory often sit on top of the JDK and need their own update to point at the fixed runtime.

If you run a Java service, treat this like a supply-chain incident

The pattern is familiar: a bug that only exists to make decoding a few hundred bytes faster (the -XX:-UseBASE64Intrinsics path is documented as pure speed optimization) becomes a systemic risk the moment it ships everywhere. If you ship a Java application, audit which of your services decode Base64 from an external source, and verify your vendor build against the fixed list before you decommission the mitigations in Step 3.

I’ve been where you are: a Java runtime sitting in a container, running quietly, nobody thought about it. Then a Tuesday arrives and an advisory says the thing you shipped for performance is the thing letting people in. Do the two checks above, then patch. That is the whole story.

Java4Shell is a reminder that the parts of a platform you never touch, and never read, are exactly the parts attackers look for. Keep your JDK on the fixed list, watch your JVM for unexpected crashes, and treat the mitigation flags as a bridge to the update, not a destination.

Three things to read next

If you found this useful, the next posts on Bleuken walk through working with AI coding agents and checking the security of the tools you ship with. Both are written the same way: practical, step-by-step, and built for people who run code, not just people who read about it.

How to Vet an AI Coding Agent Before Trusting It With Your Code

Your Agent Will Pick the Hackable One

How to Check and Patch Git’s Recursive-Clone RCE (CVE-2026-111760)


Filed under Tech & Gadgets
Last Update: November 18, 2026 by Felix AlterEgo
0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Newest
Oldest Most Voted