# Java4Shell (CVE-2026-114938): Patch Java 17, 21 and 25 on AVX-512 Hosts First

URL: https://www.devopsness.com/blog/openjdk-java4shell-cve-2026-114938-base64-avx512
Author: Kiril Urbonas
Published: 2026-11-18
Updated: 2026-11-18
Categories: DevOps
Tags: CVE, Security, Patching, Kubernetes, News

Summary: A heap overflow in the JVM's AVX-512 Base64 decoder hit the HN front page as Java4Shell. It only fires on x86-64 CPUs with AVX-512 VBMI, which covers most current cloud instances. How to find exposed JVMs, the fixed builds, and the one flag to set until you patch.

---
# Java4Shell (CVE-2026-114938): Patch Java 17, 21 and 25 on AVX-512 Hosts First

Upgrade every Java 17, 21, 25 and 27 runtime on x86-64 to the November 17 builds (17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1), starting with internet-facing services. CVE-2026-114938 is a heap overflow in the JVM's AVX-512 Base64 decoder. Where you cannot patch today, start the JVM with `-XX:-UseBASE64Intrinsics`.

> [!VERIFIED]
> Affected and fixed versions against the OpenJDK Vulnerability Advisory of 2026/11/17, Oracle's November 2026 Critical Security Patch Update risk matrix, the Amazon Corretto 17, 21 and 25 changelogs, the Adoptium release API, Calif's Java4Shell write-up and the CISA KEV catalog feed. Checked November 18, 2026.

## What happened, in dates

The bug lives in a HotSpot intrinsic: a hand-written, CPU-specific replacement for `java.util.Base64` decoding that the JIT swaps in on x86-64 processors with the AVX-512 VBMI instruction set. Per Calif, who found it, a malformed padding sequence makes the decoder miscalculate how much it may write, and it writes past the end of the destination array on the Java heap. Ordinary features that Base64-decode attacker input, such as authentication and file uploads, can reach it once the JIT has compiled the decoder.

- **November 17, 2026:** the OpenJDK Vulnerability Group publishes its advisory and Oracle ships its November Critical Security Patch Update, with 11 Java SE fixes. Calif publishes its write-up the same day. Oracle credits Quang Luong of Calif.io and Albert Yang.
- **November 17:** Amazon Corretto publishes 17.0.21.1.2, 21.0.13.1.2 and 25.0.5.1.2, each listing CVE-2026-114938 as fixed.
- **November 17-18:** the story reaches the Hacker News front page under the Java4Shell name, and a public repo ships a bounded trigger, scanners and detection rules.
- **As of November 18:** the CVE is not in CISA's KEV catalog, and Eclipse Temurin's newest GA builds are still the October releases (17.0.21+9, 21.0.13+9, 25.0.5+8), all inside the affected range.

The scores differ by who is counting. Oracle and OpenJDK rate it CVSS 3.1 **8.1** (network, no auth, high attack complexity). Calif rates it CVSS 4.0 **9.2**. Calif says the exploit chain is per application and a failed attempt can crash the JVM. It also reports pre-auth code execution in default configurations of Keycloak, Jira, Confluence, Artifactory, Jenkins and PingFederate, plus a heap-leak primitive it calls JavaBleed, which can expose tokens and keys before any code runs.

## Why the name oversells it, and why you still patch

Log4Shell hit every Java version on every CPU. This one needs three things at once:

1. **A JDK in the affected lines.** The OpenJDK advisory marks 17, 21, 25 and 27. Standard Java 8 and 11 are not listed as affected; Oracle's only affected Java 8 build is 8u511b33-perf, the Enterprise Performance Pack.
2. **An x86-64 CPU with AVX-512 VBMI.** Calif lists Intel Ice Lake, Sapphire Rapids, Emerald Rapids and Granite Rapids, and AMD Zen 4 or newer. ARM64 is not affected, so Graviton, Ampere and Apple silicon are out.
3. **Untrusted Base64 reaching the decoder.** Oracle's note says the flaw is exploited by supplying data to the affected APIs, for example through a web service.

The catch is condition 2. Ice Lake and newer Xeons and Zen 4 EPYCs power many current x86 cloud instance families, so "needs a special CPU" mostly means "needs a recent x86 server". Calif also describes a client-side path: a Java program that connects to a malicious TLS server can be hit, so outbound-only services are not automatically safe.

## Am I affected?

```bash
# 1. Does the host CPU have the vulnerable path? All four flags must print.
$ grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' \
  | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'

# 2. Which nodes in the cluster qualify? Needs Node Feature Discovery.
$ kubectl get nodes -L feature.node.kubernetes.io/cpu-cpuid.AVX512VBMI,kubernetes.io/arch

# 3. Runtime version and intrinsic state inside a running pod
$ kubectl exec -n <ns> <pod> -- sh -c \
  'java -version 2>&1 | head -1; java -XX:+PrintFlagsFinal -version 2>/dev/null | grep UseBASE64Intrinsics'

# 4. Sweep every JVM pod on a namespace (images that ship a java binary)
$ for p in $(kubectl get pods -n <ns> -o name); do
    v=$(kubectl exec -n <ns> "$p" -- java -version 2>&1 | head -1) && echo "$p  $v"
  done 2>/dev/null

# 5. Is the stopgap already set? Look for it in Deployment specs.
$ kubectl get deploy -A -o json \
  | jq -r '.items[] | select([.spec.template.spec.containers[].env[]?.value // empty] | any(test("UseBASE64Intrinsics"))) | .metadata.namespace + "/" + .metadata.name'
```

A host that prints all four CPU flags, running a JDK older than the fixed build, with `UseBASE64Intrinsics` showing `true`, has the vulnerable path live. Check 3 runs a second JVM next to your app, so it reports what a fresh JVM would pick on that node, which is what matters. Run it on a pod scheduled to an x86 node, because the answer changes with the hardware underneath.

## The patch matrix, as of November 18, 2026

| Distribution | Fixed builds | Status |
|---|---|---|
| OpenJDK upstream | jdk-17.0.21.1+2, jdk-21.0.13.1+2, jdk-25.0.5.1+2 | Tagged in jdk17u, jdk21u, jdk25u |
| Oracle Java SE | 17.0.21.1, 21.0.13.1, 25.0.5.1, 27.0.1.1, 8u513-perf | Released November 17 |
| Amazon Corretto | 17.0.21.1.2, 21.0.13.1.2, 25.0.5.1.2 | Released November 17, CVE listed |
| Eclipse Temurin | Not yet published | 17.0.21+9, 21.0.13+9, 25.0.5+8 are affected |
| Others (Zulu, Liberica, Microsoft, Red Hat, SapMachine) | Check the vendor advisory | Calif lists all as vulnerable |

The fix is a runtime upgrade, so the work is in base images. Bump the JDK or JRE in your `FROM` line, rebuild, and redeploy every service on that base, not only the ones whose code changed. Images pinned to a floating tag like `eclipse-temurin:21-jre` will pick up the fix on the next build once Temurin publishes, so note the digest you shipped and rebuild after the release lands.

## The stopgap: one flag, set through the environment

`-XX:-UseBASE64Intrinsics` turns the accelerated decoder off and falls back to the portable Java implementation. Calif and Tenable list it as a mitigation, and the public PoC repo calls it the recommended, narrow-impact option. Neither Oracle's nor OpenJDK's advisory mentions it. The JVM reads `JAVA_TOOL_OPTIONS` at startup, so you can set it without rebuilding:

```yaml
# deployment patch: java4shell-stopgap.yaml
spec:
  template:
    spec:
      containers:
      - name: app
        env:
        - name: JAVA_TOOL_OPTIONS
          value: "-XX:-UseBASE64Intrinsics"
```

```bash
$ kubectl patch deploy <name> -n <ns> --patch-file java4shell-stopgap.yaml
$ kubectl logs -n <ns> deploy/<name> | grep -m1 'Picked up JAVA_TOOL_OPTIONS'
```

The second command confirms the JVM saw the flag; HotSpot prints that line on every start. The alternative, `-XX:UseAVX=2`, turns off AVX-512 entirely. Calif warns that ARM JVMs fail to start with it, so keep it out of multi-arch manifests.

## Where this breaks

The env patch replaces any `JAVA_TOOL_OPTIONS` value the deployment already sets, so merge your existing value in first or you will silently drop agents and heap settings. It also does nothing for JVMs outside Kubernetes: Jenkins controllers on VMs, Kafka and Elasticsearch nodes, and desktop tooling each need the flag in their own launcher config. Base64-heavy workloads will get slower with the intrinsic off, so watch latency on auth gateways. Finally, scanners that read image metadata will flag the JDK version but cannot see the CPU, so expect noise on ARM nodes and blind spots on x86 pools you assumed were older. A [dependency inventory of your images](/blog/software-supply-chain-attacks) is what tells you where the bundled JREs are.

## Questions people ask

### Is Java 8 or Java 11 affected by Java4Shell?

Not by CVE-2026-114938 in standard builds. The OpenJDK advisory marks only the 17, 21, 25 and 27 lines, and Oracle's only affected Java 8 build is the 8u511b33-perf Enterprise Performance Pack, fixed in 8u513-perf. The same November release fixes other Java 8 and 11 CVEs, though, so patch those lines on your normal cycle anyway.

### Are ARM64 servers like AWS Graviton affected?

No. The vulnerable code is an x86-64 intrinsic that only runs on CPUs reporting AVX-512 VBMI. ARM64 JVMs never load it. In a mixed cluster, patch x86 node pools first, and do not put `-XX:UseAVX=2` in a shared manifest, because ARM JVMs refuse to start with it.

### Is Java4Shell being exploited in the wild?

As of November 18, 2026, it is not in CISA's KEV catalog, and Tenable reported no known exploitation on November 17. A bounded trigger is public, and Calif says application-specific exploit chains exist and will be published later. Treat the gap as days, not weeks.

## The call we'd make

Patch x86-64 JVMs today, ordered by exposure: identity providers, CI servers and anything that parses Basic auth or tokens from the internet. On Temurin, where no fixed build exists yet, roll out `-XX:-UseBASE64Intrinsics` now and rebuild once Adoptium publishes. The caveat: the flag is a stopgap the core advisories do not document, so remove it after the upgrade. Treat it the way we treated [Broccoli2Shell](/blog/brotli-cve-2026-111497-broccoli2shell-node-envoy-istio): inventory first, then patch by exposure.

## Sources

- [OpenJDK: Vulnerability Advisory 2026/11/17](https://openjdk.org/groups/vulnerability/advisories/2026-11-17)
- [Oracle: Critical Security Patch Update, November 2026](https://www.oracle.com/security-alerts/cspunov2026.html)
- [Calif: Java4Shell technical write-up](https://calif.io/java4shell/)
- [CISA: Known Exploited Vulnerabilities catalog feed](https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json)

