Java4Shell, Explained and Solved

Java4Shell, Explained and Solved

Java4Shell (CVE-2026-114938) is a heap overflow in the HotSpot AVX-512 VBMI Base64 decode intrinsic. It lives in the JDK, not in a library, so dependency scanners miss it, and exposure depends on the CPU a workload lands on. This talk covers how the bug works, how to check a JVM (CPU flag, four-part JDK version, JIT flags), the fixed builds 17.0.21.1, 21.0.13.1, 25.0.5.1 and 27.0.1.1, the -XX:-UseBASE64Intrinsics mitigation, Docker and Kubernetes remediation, and who should own the runtime. Code and examples: https://github.com/wallaceespindola/java4shell-explained-and-solved

Wallace Espindola

November 30, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

16 slides
  1. Java4Shell, Explained and Solved Finding and Fixing a Runtime Vulnerability

    Your Dependency Scanner Can't See Wallace Espindola Solution Architect [email protected] linkedin.com/in/wallaceespindola | github.com/wallaceespindola
  2. What happened 17 November 2026: Calif discloses Java4Shell, CVE-2026-114938 Same

    day: Oracle's November Critical Security Patch Update and the OpenJDK advisory A heap overflow in HotSpot's AVX-512 VBMI Base64 decode intrinsic Calif scores it 9.2 (CVSS 4.0); Oracle's top Java SE score that month is 8.1 (CVSS 3.1) No exploitation in the wild reported as of 19 November The bug is in the Java runtime, not in a library. Java4Shell, Explained and Solved 2
  3. How the bug works On capable CPUs, HotSpot swaps Base64.Decoder

    for a native stub that can write past its buffer. Java4Shell, Explained and Solved 3
  4. Why it's reachable Base64 sits on pre-authentication paths: HTTP Basic,

    JWT, SAML/OIDC, uploads, cookies A login page in front is no protection if decoding happens before the credential check Reported pre-auth: Keycloak, Jira, Confluence, Jenkins, Artifactory, PingFederate Post-auth: Kafka, Elasticsearch, Solr, Gerrit Exposure always also depends on the JDK build and the CPU underneath. Java4Shell, Explained and Solved 4
  5. Crash is easy, RCE is contested Calif demonstrated remote code

    execution in lab conditions Independent reproductions confirmed the overflow, called reliable RCE hard OX Security estimated fewer than 0.12% of JVMs at realistic RCE risk A JVM crash is easy to trigger: treat every exposed instance as DoS-vulnerable Java4Shell, Explained and Solved 5
  6. Four conditions, all required 1 2 3 4 x86-64 CPU

    with AVX-512 VBMI Affected JDK: 17.0.6+, 21, 25, 27 before the fix, or Java 8 Performance Pack UseAVX=3 (default on those CPUs) UseBASE64Intrinsics=true (default) ARM64, standard Java 8 and 11, and CPUs without VBMI are not affected. Java4Shell, Explained and Solved 6
  7. The fix is in the fourth number Java line First

    fixed (Oracle/OpenJDK) 8 Performance Pack 8u513-perf 17 17.0.21.1 21 21.0.13.1 25 25.0.5.1 27 27.0.1.1 21.0.13 is vulnerable, 21.0.13.1 is not. Vendors number their builds differently. Java4Shell, Explained and Solved 7
  8. Below the pom Log4Shell and Spring4Shell were in the pom.

    Java4Shell isn't, so SCA scanners won't see it. Java4Shell, Explained and Solved 8
  9. Triage in four questions Ask them on the production host,

    with the production java binary. Java4Shell, Explained and Solved 9
  10. Check a host grep -qw avx512vbmi /proc/cpuinfo && echo "CPU:

    avx512vbmi present" java -version java -XX:+PrintFlagsFinal -version | grep -E 'UseAVX|UseBASE64Intrinsics' jcmd <pid> VM.flags -all | grep -E 'UseAVX|UseBASE64Intrinsics' Trimmed from examples/detect/check-host.sh and the context doc in the repo. Java4Shell, Explained and Solved 10
  11. Check from inside the JVM java examples/detect/Java4ShellCheck.java java examples/detect/Java4ShellCheck.java --self-test

    make run && curl -s localhost:8080/check && make kill # exit 0 safe, 1 exposed, 2 unknown # built-in checks # as an HTTP service One dependency-free Java file: HotSpotDiagnosticMXBean for flags, Runtime.Version for the build. Java4Shell, Explained and Solved 11
  12. Patch, then rebuild # Patched: pin the fixed release by

    digest once you have verified it reports 21.0.13.1 or the vendor equivalent. FROM eclipse-temurin:21-jre@sha256:<verified-digest-of-patched-image> WORKDIR /app COPY target/application.jar app.jar ENTRYPOINT ["java", "-jar", "app.jar"] docker build --pull --no-cache, then check java -version inside the image. Java4Shell, Explained and Solved 12
  13. Mitigate until patched -XX:-UseBASE64Intrinsics : targeted, disables the Base64 intrinsics

    only -XX:UseAVX=2 : broad, disables all AVX-512 paths, bigger cost Not DisableIntrinsic=_base64_decodeBlock alone JAVA_TOOL_OPTIONS replaces existing values: merge them Or schedule exposed workloads on ARM64 / non-VBMI nodes Measure the slowdown on JWT-heavy services, and remove the flag after patching. Java4Shell, Explained and Solved 13
  14. Fleet remediation in six steps Inventory the JDK version and

    the CPU. Verify running versions, not image tags. Java4Shell, Explained and Solved 14
  15. What to change for next time Treat the runtime as

    a platform product with one owner Golden base images: one update rebuilds every service SBOMs that include the JDK, not only Maven artifacts Admission policies that reject known-bad runtimes Hardware-aware inventory: instance type is now a security attribute Being able to patch and redeploy the whole stack fast is itself a security control. Java4Shell, Explained and Solved 15
  16. Thank You Checker, examples, diagrams, articles and slides github.com/wallaceespindola/java4shell-explained-and-solved Wallace

    Espindola, Solution Architect linkedin.com/in/wallaceespindola | speakerdeck.com/wallacese

More Decks by Wallace Espindola

Other Decks in Technology