Memory corruption in OpenJDK HotSpot's AVX-512 VBMI Base64 decoding intrinsic. A malformed 65-byte input (`"A"×64 + "="`) causes an integer underflow in the output mask calculation, producing a full 64-bit write mask. The resulting `VMOVDQU8` writes **62 bytes past the end of the heap buffer**.
Discovered by [Quang Luong]( of Calif.io using AI-assisted vulnerability research. Pre-auth RCE demonstrated against Keycloak, Jira, Confluence, Jenkins, Artifactory, and PingFederate.
**Author:** [Qi Deng]( | **Disclosure:** [calif.io/java4shell]( | **Date:** 2026-11-17
| **CVSS v4.0 / v3.1** | 9.2 Critical / 8.1 High |
| **CWE** | CWE-191 (Integer Underflow) → CWE-122 (Heap Buffer Overflow) |
| **Component** | `hotspot/compiler` — `StubGenerator::generate_base64_decodeBlock()` |
| **Fix** | [JDK-8393212]( — 3-line `length < 4` guard |
| 21 | All before 21.0.13.1 | 21.0.13.1 |
**Hardware requirement:** x86-64 with AVX-512 VBMI — Intel Ice Lake+ (Xeon 3rd Gen+) or AMD Zen 4+ (EPYC Genoa / Ryzen 7000+). **ARM64 is NOT affected.**
All OpenJDK-based distributions are vulnerable: Oracle Java SE, Temurin, Corretto, Zulu, Liberica, SapMachine, Red Hat OpenJDK, GraalVM.
- Keycloak · Atlassian Jira · Atlassian Confluence · JFrog Artifactory · Jenkins · PingFederate
- Apache Kafka Broker · Apache Solr · Elasticsearch · Gerrit · Spinnaker
**Attack surface:** Any Java application that decodes untrusted Base64 via `java.util.Base64` — HTTP Basic Auth, JWT tokens, SAML assertions, file uploads, API payloads, TLS (client-side).
output_size -= 1 = -1 (UNDERFLOW)
bzhiq(-1, 0xFF) = 0xFFFFFFFFFFFFFFFF (all bits set)
evmovdqub [dst+48], mask, zmm → writes ALL 64 bytes
The `BZHI` instruction treats the index as `unsigned [7:0]`. When `output_size = -1`, the low byte is `0xFF = 255`, which exceeds the 64-bit register width, so no bits are cleared — full mask → full 64-byte write.
The trigger proves the memory corruption is real. It uses a 4096-byte destination array so the overflow stays contained (safe to run).
rejected=true changed=62 first=50 last=111
**Verified on:** GCE `c3-standard-4` (Intel Xeon Platinum 8481C, Sapphire Rapids) + Temurin 21.0.13+9-LTS.
| 21, 25, 27 | `"A" × 64 + "="` (65 bytes) |
| 17 (17.0.6+) | `"A" × 128 + "="` (129 bytes) |
Tests the trigger, then confirms both mitigation flags (`-XX:-UseBASE64Intrinsics` and `-XX:UseAVX=2`) prevent the corruption.
Checks all Java installations on the local machine for vulnerability:
Verifies: CPU flags (AVX-512 VBMI) → Java version → running JVM mitigation flags.
Probes remote hosts for vulnerable Java versions via HTTP headers, TLS certs, and service banners:
python3 scanner/java4shell_scan.py --host app.example.com
python3 scanner/java4shell_scan.py --cidr 10.0.0.0/24 --ports 8080,8443
python3 scanner/java4shell_scan.py --targets hosts.txt --threads 50
python3 scanner/java4shell_scan.py --host app.example.com --json
Pre-built IDS / WAF / SIEM rules in [`detection/`](detection/):
| `java4shell.rules` | Suricata / Snort | 6 rules — malformed Base64, trigger patterns, warm-up, crash indicators |
| `java4shell.yaml` | Sigma | 5 rules — web logs, JVM crashes, GC SIGSEGV, exception floods |
| `modsecurity.conf` | ModSecurity v2/v3 | 6 rules — drop-in for Apache/Nginx |
- Malformed Base64 padding in `Authorization: Basic` headers (length % 4 ≠ 0)
- Exact trigger patterns (`"A"×64 + "="` or `"A"×128 + "="`)
- High-frequency Base64 auth requests from single source (JIT warm-up phase)
- `IllegalArgumentException` from Base64 decoder (thrown after corruption)
- `hs_err_pid*.log` crash files with `SIGSEGV` in G1 GC / `StubRoutines`
git clone && cd java4shell-poc
# Start the lab (requires x86-64 Docker host with AVX-512 VBMI)
cd lab && chmod +x setup.sh && ./setup.sh
# Or run directly (if Java is installed locally)
cd poc && javac Base64Trigger.java && java Base64Trigger
│ ├── Base64Trigger.java # Memory corruption trigger (CVE-2026-114938)
│ ├── verify_corruption.sh # Full verification with mitigation tests
│ └── run.sh # Quick compile-and-run helper
│ ├── java4shell_scan.sh # Host scanner (JDK + CPU check)
│ └── java4shell_scan.py # Network scanner (HTTP/TLS/banner probing)
│ ├── java4shell.rules # Suricata / Snort IDS rules
│ ├── java4shell.yaml # Sigma SIEM detection rules
│ └── modsecurity.conf # ModSecurity WAF rules
│ ├── Dockerfile # Vulnerable Java environment
│ ├── docker-compose.yml # Lab with optional Keycloak
│ └── setup.sh # One-click lab setup
│ ├── ANALYSIS.md # Full technical analysis
│ └── cover.svg # Cover art
[JDK-8393212]( — committed 2026-11-16, titled "Base64 optimization improvements":
+// A padded Base64 tail shorter than one complete block is handled by Java.
Routes tails shorter than 4 bytes to the safe scalar decoder before the BZHI underflow can occur.
**Upgrade Java immediately** to 17.0.21.1 / 21.0.13.1 / 25.0.5.1 / 27.0.1.1.
# Interim — disable Base64 intrinsic (recommended, narrow impact)
# Interim — disable AVX-512 entirely (x86-64 only — do NOT use on ARM)
export JAVA_TOOL_OPTIONS="-XX:-UseBASE64Intrinsics"
After upgrading: restart all JVM processes, rebuild container images.
| | Heartbleed | Log4Shell | Spring4Shell | **Java4Shell** |
| **Bug class** | Over-read | Injection | Class manipulation | Integer underflow → heap overflow |
| **Trigger** | TLS heartbeat | `${jndi:…}` | HTTP params | `"A"×64 + "="` |
| **Exploitation** | Trivial | Trivial | Moderate | Complex (heap feng shui) |
| **Universal** | Yes | Yes | Partial | No (per-target + HW-gated) |
- [Calif.io disclosure]( — Original research by Quang Luong
- [OpenJDK advisory](
- [Oracle CPU](
- [Fix commit 5177a70b385c](
- [Datadog Security Labs analysis](
- [JFrog analysis](
- [Upwind / java4shell.net](
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
