Java4Shell (CVE-2026-114938) went public on 17 November 2026, and the first question most teams ask is a plain one: is this JVM exposed or not? The answer depends on three things you can check in a few minutes per host. One is the CPU, one is the full Java version and one is a pair of JIT flags. If any of the three says no, that JVM is not exposed today, even if the patch still belongs on your list.

This article covers the hands-on part. You check one box, then you fix it: the shell commands, the small checker in the companion repo (run it once, or run it as a service and read the JSON), the Docker images before and after, the Kubernetes mitigation patch and node affinity, and finally the patch itself. Everything quoted here lives in the examples repository.

What you are looking for

The flaw is heap memory corruption in HotSpot's AVX-512 Base64 decode intrinsic, the code behind java.util.Base64.Decoder. It was disclosed by Calif on the same day Oracle shipped its November 2026 Critical Security Patch Update and the OpenJDK Vulnerability Group published its advisory.

On CPUs with AVX-512 VBMI, HotSpot swaps the pure-Java decode loop for a hand-written vectorized stub. For specially malformed input, that stub writes past the end of the output buffer before Java's normal validation rejects the string. Published analyses put the overrun at roughly 62 to 64 bytes. Java's memory safety applies to bytecode, not to JIT-generated native stubs, so the write corrupts adjacent heap memory.

Attack flow: a malformed Base64 string reaches the AVX-512 VBMI decode stub, causing an out-of-bounds heap write that leads to a JVM crash or, with heap grooming, potential remote code execution

Two things make this different from Log4Shell for the person doing the checking. The bug is in the runtime, not a library, so a fully updated Maven or Gradle build can still be vulnerable and dependency-only (SCA) scanners won't see it. And it depends on hardware: the same container image can be exposed on one node pool and safe on another.

Check one box: three questions per JVM

The vulnerable stub is selected only when all of these hold, per the context doc in the repo and the analyses it cites:

  1. An x86-64 CPU with AVX-512 VBMI (the avx512vbmi CPU flag).
  2. An affected JDK build: OpenJDK 17.0.6 and later, 21, 25 and 27 before their fix releases, or the Oracle Java 8 Enterprise Performance Pack.
  3. HotSpot running with UseAVX=3 and UseBASE64Intrinsics=true, which are the defaults on such CPUs.

Standard Java 8 and 11 are not affected. Neither is ARM64 (Graviton, Apple Silicon, Ampere) or x86-64 without VBMI. On the Intel side, Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids have VBMI. Skylake-SP and Cascade Lake have AVX-512 without VBMI, so they are not exposed. On AMD, Zen 4 and newer are exposed, Zen 3 and older are not.

Here is the triage flow I'd follow for each Java process:

Triage flowchart: check for avx512vbmi on an x86-64 CPU, then an unpatched affected JDK, then UseAVX=3 and UseBASE64Intrinsics=true, then whether untrusted Base64 is reachable before authentication, ending in not exposed, mitigated, high or critical

The last question in the flow is about your code, not the box. Base64 decoding sits on many pre-authentication paths (HTTP Basic Authorization headers, JWT parsing, SAML and OIDC payloads, cookies, webhook signatures), so a login page in front of the app is no protection if the decode happens before the credential check.

The commands

Run these against the production runtime on the production host, not on a laptop. These come straight from the repo's context doc:

# 1. CPU: does the host expose AVX-512 VBMI? (Linux) grep -o -m1 'avx512vbmi' /proc/cpuinfo || echo "no avx512vbmi: not exposed" # 2. Runtime version (full four-part version matters) java -version docker run --rm --entrypoint java my-app:latest -version # 3. Effective JIT flags of the exact binary the app uses java -XX:+PrintFlagsFinal -version | grep -E 'UseAVX|UseBASE64Intrinsics' # 4. Flags of an already running JVM jcmd <pid> VM.flags -all | grep -E 'UseAVX|UseBASE64Intrinsics' 

Step 2 is where people slip. The fix lives in the fourth version number: 21.0.13 is still vulnerable, 21.0.13.1 is not. Dashboards, regexes and scanners that keep only three components will report both as the same build. The DEV Community post on the fourth version number covers that trap in detail.

If you'd rather not type all of that, the repo wraps the host part in examples/detect/check-host.sh:

#!/usr/bin/env bash # Quick Java4Shell (CVE-2026-114938) triage for one Linux host and one java binary. # Usage: examples/detect/check-host.sh [/path/to/java] set -uo pipefail JAVA="${1:-java}" if grep -qw avx512vbmi /proc/cpuinfo 2>/dev/null; then echo "CPU: avx512vbmi present" else echo "CPU: no avx512vbmi (or not Linux x86-64): not exposed on this host" fi echo "Runtime: $("$JAVA" -version 2>&1 | head -1)" "$JAVA" -XX:+PrintFlagsFinal -version 2>/dev/null | grep -E '\b(UseAVX|UseBASE64Intrinsics)\b' 

Pass the path to the exact java binary your application starts with. Servers often have more than one JDK installed, and the one on the PATH is not always the one in the service unit.

The checker: one file, one verdict

The shell script prints facts and leaves the conclusion to you. examples/detect/Java4ShellCheck.java goes one step further: it inspects the JVM it runs in and returns a verdict. It is a single file with no dependencies, so you can launch it with java directly.

The decision is a few lines, trimmed from the repo:

 static Verdict verdict(String arch, Optional<Boolean> vbmi, boolean affected, int useAvx, boolean b64) { boolean x86 = arch.equals("amd64") || arch.equals("x86_64"); if (!x86 || !affected || useAvx < 3 || !b64) { return Verdict.NOT_EXPOSED; } return vbmi.map(has -> has ? Verdict.EXPOSED : Verdict.NOT_EXPOSED).orElse(Verdict.UNKNOWN); } 

Any single "no" ends the check. Only when the architecture, the build and both flags line up does the CPU flag decide, and if /proc/cpuinfo can't be read the answer is UNKNOWN instead of a guess. The flag values come from HotSpotDiagnosticMXBean, so they reflect what the running JVM uses, including anything set through JAVA_TOOL_OPTIONS.

The version check compares all four components against the first fixed release of each line (also trimmed from the repo):

 int[] fixed = switch (v.feature()) { case 17 -> new int[] {17, 0, 21, 1}; case 21 -> new int[] {21, 0, 13, 1}; case 25 -> new int[] {25, 0, 5, 1}; case 27 -> new int[] {27, 0, 1, 1}; default -> null; }; 

Those are the upstream and Oracle numbers. More on vendor numbering in the limits section below.

Run it once

From the repo root:

make check-jvm # java examples/detect/Java4ShellCheck.java make self-test # the built-in checks 

The exit code is the verdict: 0 not exposed, 1 exposed, 2 unknown. That makes it usable as a gate in a CI job or a startup script. Here is the real output on my Apple Silicon laptop:

javaVersion 25.0.5+9-LTS javaVendor Amazon.com Inc. osArch aarch64 avx512vbmi unknown useAvx 0 useBase64Intrinsics true affectedBuild true verdict NOT_EXPOSED 

This is a useful example because it looks scary at first glance. affectedBuild is true (25.0.5 is below 25.0.5.1), and useBase64Intrinsics is true. But the architecture is aarch64, so the AVX-512 path doesn't exist here. UseAVX isn't even a flag on ARM64, which is why it reads 0, and there is no /proc/cpuinfo on macOS, hence unknown. Not exposed on this box, and still due for the patch on the normal cadence.

Run it as a service

Sometimes you want to ask a host from the outside, or keep a check endpoint next to other health probes. The checker has a --serve mode with GET /health and GET /check, and the repo wraps it in scripts/run.sh and scripts/kill.sh:

make run # scripts/run.sh 8080, starts service in background make status # curl -s localhost:8080/check make kill # scripts/kill.sh 

run.sh writes a PID file and a log under .run/, and refuses to start a second copy. The /check response is the same report as JSON, plus a timestamp:

{"javaVersion":"25.0.5+9-LTS","javaVendor":"Amazon.com Inc.","osArch":"aarch64","avx512vbmi":"unknown","useAvx":"0","useBase64Intrinsics":"true","affectedBuild":"true","verdict":"NOT_EXPOSED","timestamp":"2026-11-27T22:51:48.200959Z"} 

Read it left to right, the way the triage diagram reads top to bottom. osArch and avx512vbmi answer the CPU question, javaVersion and affectedBuild the build question, useAvx and useBase64Intrinsics the flags question, and verdict combines them. All values are strings, so compare "EXPOSED", not a boolean.

There is also a Dockerfile and docker-compose.yml for the service (make docker-build, make docker-up). Keep in mind what that container measures: the Temurin 25 JRE inside the checker's image, on whatever CPU the container lands on. That is a good way to probe a node's CPU, but it says nothing about your application's JDK. For that, run the checker with the same java binary and the same JAVA_TOOL_OPTIONS as the application.

Server rack with rows of blinking green status lights in a data center

Photo by Domaintechnik on Unsplash

Then fix it: Docker before and after

Here is the vulnerable image from examples/docker/Dockerfile.vulnerable:

# Vulnerable: 21.0.13 predates the 21.0.13.1 fix for CVE-2026-114938. FROM eclipse-temurin:21.0.13-jre WORKDIR /app COPY target/application.jar app.jar ENTRYPOINT ["java", "-jar", "app.jar"] 

Nothing in it looks wrong. The tag is pinned and specific, and it is still one patch release short.

If the patched base image isn't available yet, or your rollout takes longer than you'd like, the mitigation turns off the Base64 intrinsic. From examples/docker/Dockerfile.mitigated:

# Temporary mitigation until the patched image ships. Merge with any JAVA_TOOL_OPTIONS you already set. FROM eclipse-temurin:21.0.13-jre ENV JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics" WORKDIR /app COPY target/application.jar app.jar ENTRYPOINT ["java", "-jar", "app.jar"] 

Read the comment on the first line. JAVA_TOOL_OPTIONS overrides any existing value, so if your image already sets memory or GC options there, merge them instead of replacing them. -XX:UseAVX=2 also closes the hole, but it disables every AVX-512 code path, not just Base64, and costs more. And don't rely on -XX:DisableIntrinsic=_base64_decodeBlock on its own, because analyses warned it does not reliably cover the vulnerable path.

The fix is a new base image. From examples/docker/Dockerfile.patched:

# 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"] 

Then rebuild without the cache and check what actually ended up inside:

docker build --pull --no-cache -t my-app:patched . docker run --rm --entrypoint java my-app:patched -version # expect 21.0.13.1 or the vendor equivalent 

A floating tag such as 21-jre only helps if it is re-pulled, and --pull forces that. The digest makes the fix reproducible, and Renovate or Dependabot can propose digest bumps from there. This is a patch-level update, so no business logic changes and no Java major-version migration.

Kubernetes: mitigate in place, or move off the exposed nodes

In a cluster the CPU check has to run on the node, not inside a build container. With Node Feature Discovery installed, nodes carry CPU feature labels, and examples/kubernetes/inventory.sh lists the VBMI nodes plus the Java version in each running pod (trimmed from the repo):

echo "Nodes advertising AVX-512 VBMI:" kubectl get nodes -l feature.node.kubernetes.io/cpu-cpuid.AVX512VBMI=true -o name echo echo "Java runtime per pod:" kubectl get pods -A --field-selector=status.phase=Running \ -o jsonpath='{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{" "}{.spec.nodeName}{"\n"}{end}' | while read -r ns pod node; do version="$(kubectl exec -n "$ns" "$pod" -- java -version 2>&1 | head -1)" echo "$ns/$pod on $node: ${version:-no java}" done 

It assumes java is on the PATH and pods are single-container, so treat it as a quick look. For a whole fleet, an image scanner or runtime inventory does the job better.

For the exposed workloads, you have two short-term options. The first is the same flag as in Docker, applied as a strategic-merge patch from examples/kubernetes/mitigation.yaml:

# Strategic-merge patch: disable the Base64 intrinsic until the patched image is deployed. # kubectl patch deployment my-app --patch-file examples/kubernetes/mitigation.yaml spec: template: spec: containers: - name: my-app env: - name: JAVA_TOOL_OPTIONS value: "-XX:-UseBASE64Intrinsics" 

The container name must match your deployment's container, because that is how the merge finds it. Patching the pod template triggers a rollout, so the pods restart with the flag. Confirm it took effect with jcmd <pid> VM.flags inside a pod, or with the checker's useBase64Intrinsics field. Some products (Jira, Keycloak, Jenkins) keep their own JVM options files, so follow their guidance: Keycloak issue #55293 and the Jenkins blog post.

The second option is to keep the workload off VBMI nodes altogether, from examples/kubernetes/avoid-vbmi-nodes.yaml:

# Strategic-merge patch: keep a workload off nodes that advertise AVX-512 VBMI (needs Node Feature Discovery). # kubectl patch deployment my-app --patch-file examples/kubernetes/avoid-vbmi-nodes.yaml spec: template: spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: feature.node.kubernetes.io/cpu-cpuid.AVX512VBMI operator: DoesNotExist 

This uses the hardware condition as the control, since the vulnerable stub is never selected without VBMI. Scheduling exposed workloads onto ARM64 or non-VBMI node pools is a valid containment step. Watch the DoesNotExist operator, though. If Node Feature Discovery isn't running, no node has the label, every node matches and the patch does nothing. And if all your nodes are VBMI nodes, the pods go Pending. Check the label output from inventory.sh before you rely on it.

Then patch: the fixed versions

Both mitigations only buy time, and the ticket closes when the patched build is running. Minimum fixed versions, in Oracle and OpenJDK numbering:

Java line Minimum fixed
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

Java 11 isn't affected, but 11.0.33.1 ships other fixes from the same patch update, so patch it anyway. Every HotSpot-based distribution inherits the bug (Eclipse Temurin, Amazon Corretto, Azul Zulu, Red Hat build of OpenJDK, Microsoft Build of OpenJDK, distro packages), and each one uses its own build numbers and timelines. In the first days after disclosure, several vendors had trackers open without fixed builds. Check your vendor's advisory for the exact package version.

After the rollout:

  1. Re-run the checker or java -version against the running pods, not just the image tags.
  2. Remove the JAVA_TOOL_OPTIONS mitigation and the node affinity patch, so you get the intrinsic's performance back.
  3. Look at the crash history from before the patch: hs_err_pid*.log, SIGSEGV and container restarts with exit code 134 or 139 on AVX-512 nodes. Repeated crashes there may indicate probing.

Trade-offs and limits

A few things to keep in mind before you call it done:

  • The mitigation costs performance: expect slower Base64 decoding, which matters for JWT-heavy gateways and upload services. Measure it. -XX:UseAVX=2 affects every vectorized intrinsic and costs more than the targeted flag.
  • RCE is contested, the crash isn't: Calif demonstrated RCE in lab conditions. Independent reproductions confirmed the heap overflow but described reliable RCE as hard, since it depends on heap layout, GC, JIT state and the code path. OX Security estimated that fewer than 0.12% of JVMs are at realistic risk of RCE. A crash is easy, so treat every exposed instance as at least DoS-vulnerable.
  • The severity score depends on who you ask: Calif rates it 9.2 Critical (CVSS 4.0), while Oracle's November patch update lists a top Java SE score of 8.1 (CVSS 3.1). No in-the-wild exploitation had been reported as of 19 November 2026.
  • Vendor numbering differs: the checker hard-codes the upstream fix versions. A vendor build that carries the fix under another number can show up as affected, or the other way around, so the vendor advisory wins over the checker.
  • The checker has blind spots: it reads /proc/cpuinfo, so outside Linux it reports UNKNOWN on x86-64. It uses Runtime.version() and single-file launch, so it can't run on Java 8, which means the 8 Performance Pack needs a manual version check against 8u513-perf.
  • A WAF is not a fix: gateway rules that reject malformed or oversized Base64 reduce noise but can be bypassed.

So the order of work stays the same: check, mitigate where the box says exposed, patch, then remove the mitigation.

Recap

You can answer "is this JVM exposed" with three checks: avx512vbmi on an x86-64 CPU, a four-part version below the fix release, and UseAVX=3 with UseBASE64Intrinsics=true. The repo's checker does the same in one command, with an exit code for scripts and a JSON endpoint for everything else. If the answer is yes, -XX:-UseBASE64Intrinsics or a node affinity rule buys you time, and a rebuilt image on the fixed JDK closes it. For the wider picture, the Datadog Security Labs and Eclypsium write-ups are good next reads.

How are you tracking the fourth version number across your fleet? I'd like to hear in the comments.

Examples repository: every example in this article (the Java4Shell checker, the run scripts, the Docker and Kubernetes examples and the diagrams) is in https://github.com/wallaceespindola/java4shell-explained-and-solved.

Need more tech insights?
Check out my GitHub, LinkedIn, and Speaker Deck.
Happy coding!

Wallace Espindola, Solution Architect