Originally published on proxymint.
Java4Shell is an OpenJDK Base64 heap bug on x86-64 with AVX-512 VBMI. Check your CPU flags, java -version and bundled JVMs, then patch or set the stopgap.
TL;DR
-
Run the CPU flag check before anything else. If
/proc/cpuinfolacks any of avx512f, avx512bw, avx512vbmi or bmi2, Java4Shell can't fire on that box today, and every ARM64 server is out of range. -
Then compare
java -versionwith 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1. Anything older on 17.0.6 or later is in range. Java 8 and 11 don't have the vulnerable code, per Red Hat. -
Images carry their own JVM, so check inside them.
docker run --rm --entrypoint java IMAGE -versiontakes seconds, and Red Hat already lists its Keycloak and Kafka images as affected. -
Can't patch today? Set
-XX:-UseBASE64Intrinsics. Calif's other flag,-XX:UseAVX=2, stops the JVM starting on ARM, which is easy to miss on a multi-arch image.
Key takeaways
- Both conditions matter. The bug needs an x86-64 CPU with AVX-512 VBMI and a JDK from 17.0.6 on, so check the hardware and the version, not one of them.
- Restart after the upgrade. A JVM that's still running keeps the old runtime loaded until the process exits, whatever the package says.
-
Put the stopgap in
JAVA_TOOL_OPTIONSfor containers, append rather than overwrite, and confirm with-XX:+PrintFlagsFinalthat the flag reads false. - Read the scores side by side. Oracle says 8.1, Red Hat 9.8 and Calif 9.2, and all three lead to the same action: patch the exposed JVMs first.
Read the full guide on proxymint, with the commands, tables and sources.
Top comments (0)