Java4Shell: The CPU Gate That Decides Whether CVE-2026-114938 Can Touch You

Share
Java4Shell: The CPU Gate That Decides Whether CVE-2026-114938 Can Touch You
A malformed Base64 login string overflowing OpenJDK's AVX-512 decoder on a vulnerable server.

The unusual thing about Java4Shell is that the same container image is exploitable on one server and completely safe on another, with no difference in the software. CVE-2026-114938 is a pre-authentication heap overflow in OpenJDK's hardware-accelerated Base64 decoder, and researchers at Calif demonstrated it as full remote code execution against default installs of Keycloak, Jira, Confluence, Artifactory, Jenkins, and PingFederate. But the vulnerable code only runs on x86-64 CPUs with AVX-512 VBMI. That gate is the whole story for a fleet operator: your exposure is not "do I run Java," it is the intersection of three facts per host, the CPU, the Java version, and whether an exposed app feeds attacker-controlled Base64 to the decoder. Fixes shipped from Oracle and OpenJDK on November 17. Here is the triage, grounded in verification against the vendor advisories as of November 18.

The Three Conditions, All Required

A host is exposed only when all three hold. Miss any one and this CVE cannot reach you, which is why blanket "patch all Java now" misses the point and wastes effort on hosts that were never in range.

  1. The CPU supports AVX-512 VBMI. Intel Xeon Ice Lake through Granite Rapids (Sapphire/Emerald/Granite Rapids), or AMD Zen 4 and newer (EPYC Genoa, Ryzen 7000+). ARM64 is entirely unaffected, the intrinsic does not exist there.
  2. The Java runtime is affected. OpenJDK 17.0.6 or later on the 17 line, plus Java 21, 25, and 27, from any vendor (Oracle, Corretto, Zulu, Temurin, Liberica, SapMachine, Red Hat, GraalVM). Standard Java 8 and 11 are not affected, with one exception: the Java SE 8 Enterprise Performance Pack 8u511b33-perf.
  3. An attacker can reach the decoder. Servers routinely Base64-decode untrusted input before authentication: HTTP Basic auth headers, SAML artifacts, JWT tokens, CSRF tokens, MIME encoded-words, file uploads. Any of those paths hands java.util.Base64.Decoder attacker-controlled bytes, which is why the demonstrated targets are exploitable pre-auth.

The 17.0.6 boundary is not arbitrary: the AVX-512 Base64 decoding intrinsic (JDK-8268276) was backported from JDK 18 into the 17 line and first shipped in 17.0.6 (January 2023). Before that release, the fast decoder simply is not present.

Check Your Fleet

CPU check, the fastest filter

Run this first, because it eliminates the most hosts fastest. The vulnerable path needs four CPU features present together. All four must appear or the host's CPU cannot run the vulnerable code:

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

If that returns fewer than four lines, the CPU is not capable and this host is out of scope regardless of Java version. Across the fleet:

for h in $(cat hosts.txt); do n=$(ssh -o ConnectTimeout=5 "$h" "grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -cE '^(avx512f|avx512bw|avx512vbmi|bmi2)\$'" 2>/dev/null); printf '%s: %s/4 AVX-512 features%s\n' "$h" "${n:-?}" "$([ "$n" = 4 ] && echo '  <-- IN SCOPE' || echo '')"; done

A critical consequence for container and VM fleets: because this is gated on CPU features exposed to the guest, the identical image is vulnerable on an AVX-512 node and safe on an older one, and live-migrating a VM onto a newer host can silently bring the vulnerable path online. Do not reason about exposure from the image alone; reason from where it runs.

Java version check

On an in-scope host, find every Java runtime and its version:

for j in $(find / -name java -type f 2>/dev/null); do printf '%s: ' "$j"; "$j" -version 2>&1 | head -1; done

Anything reporting 17.0.6 through the pre-fix 17 builds, or any 21/25/27 below the fixed release, is affected on an AVX-512 host. Do not forget runtimes bundled inside products, many Java apps ship their own JRE (Elasticsearch, Jenkins, Atlassian products, Artifactory), so a system-wide java -version can miss the one that is actually exposed. Those need an update from the product vendor, not just an OS package bump.

Vendor-string trap

Version string alone will not tell you if a distro backported the fix, same caution as any kernel CVE. Check your distribution's and product's advisory for the specific patched build rather than eyeballing the number. The fixed Oracle builds are the .1 releases: 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1. Corretto, Zulu, and SapMachine shipped their equivalents the same week. Red Hat had not released fixed RHEL or OpenJDK builds as of November 18, so RHEL-family hosts may be patch-pending, containers built on Red Hat images need rebuilding once fixed images land, and Temurin, Microsoft Build of OpenJDK, and Liberica were also still pending at disclosure. Verify current status before assuming a fix exists for your distro.

If You Cannot Patch Yet: The JVM Flags, With One Correction

Two startup flags disable the vulnerable path, and remove them once the fixed build is in:

-XX:-UseBASE64Intrinsics

This disables only the Base64 intrinsic, leaving other AVX-512 speedups intact. It is the narrower, preferred stopgap.

-XX:UseAVX=2

This disables AVX-512 entirely. Two corrections the pasted advisories get incomplete. First, use it only on x86-64, Java on ARM64 does not recognize it and the JVM fails to start (irrelevant to exposure there, but it will break your startup). Second, and more important: on Java 21 and later, the Base64 intrinsic also has an AVX2 path, so -XX:UseAVX=2 does not fully mitigate on 21/25/27, it only removes the AVX-512 route. On those versions, -XX:-UseBASE64Intrinsics is the one that actually closes the hole. On Java 17 the intrinsic is AVX-512-only, so either flag works there. Given that split, standardize on -XX:-UseBASE64Intrinsics across the fleet so you are not tracking which host runs which Java line.

Do not use -XX:DisableIntrinsic=_base64_decodeBlock on its own, testing shows it prevents the JVM from starting.

Detection: What to Watch For

None of these proves compromise and their absence does not prove safety, but they are the signals worth alerting on:

  • Malformed Base64 in auth paths: tokens of 32+ characters ending in = whose length is not a multiple of 4, especially in Authorization headers. That shape is the trigger.
  • Bursts of IllegalArgumentException from java.util.Base64$Decoder in application logs, the JVM rejects the malformed string, but only after the overflow write.
  • hs_err_pid crash logs or bursts of JVM restarts, a failed exploitation attempt often crashes Java, and attackers retry. Blackpoint's lab crashed a Spring Boot app with ~28,300 malformed requests in roughly 20 seconds, so a spike of crashes is a strong tell.

A WAF or reverse proxy that buffers full requests (nginx by default) blocks some attack variants but not all, and a crash-and-retry attacker gets many attempts. Treat proxy filtering as a speed bump, not a fix. If you front these apps with a WAF, add a rule flagging oversized malformed-Base64 Authorization values as an interim layer, but patch underneath it.

The Supply-Chain Lesson Worth Taking

This is the part that should change how you think about dependency scanning. The bug is in java.base itself, hand-written AVX-512 assembly inside the runtime, so no SBOM or image scanner flags it. Java is in use, Base64 is in use, and the optimization is part of the thing, there is no vulnerable package to detect, only a vulnerable version of the runtime on specific hardware. The same inventory discipline that makes a Log4Shell-style response fast, knowing every runtime version across the estate, is exactly what this needs, except here you must also correlate CPU capability, which most inventories do not track at all. If your asset data cannot answer "which of my hosts run Java 17.0.6+ on an AVX-512 CPU with an internet-facing Base64-decoding app," this CVE is a prompt to start collecting that third axis.

And the clock was already running before the patch: a malformed input triggering the overflow was posted publicly on September 9 in an OpenJDK pull request, then closed unmerged in early November after an inactivity notice. The root cause and technique are public, Calif is holding only its weaponized chains, and it was not on CISA's KEV catalog as of November 18. That last point is thin comfort, not reassurance.

Bottom Line

Java4Shell is a real pre-auth RCE, but it is gated on a CPU feature, which flips the response from panic-patch-everything to triage. Run the AVX-512 check first to drop every host that cannot run the vulnerable code, inventory Java 17.0.6+ / 21 / 25 / 27 on the survivors (bundled runtimes included), and prioritize the ones running internet-facing Keycloak, Jira, Confluence, Artifactory, Jenkins, or PingFederate. Patch to the fixed .1 builds where your vendor has shipped them, and where they have not, Red Hat included as of today, apply -XX:-UseBASE64Intrinsics (not -XX:UseAVX=2, which does not fully cover Java 21+). Then restart the JVM and rebuild the container images so the running process actually uses the fix. The CPU gate is doing you a favor, use it to aim.


References

Read more