Java4Shell
Java4Shell (CVE-2026-114938) is a memory-corruption vulnerability in OpenJDK’s hardware-accelerated Base64 decoder, disclosed on November 17, 2026 by Calif. A remote attacker who can deliver crafted Base64 data to an affected application can overwrite heap memory, leak its contents, and reach remote code execution. Calif rates it CVSS v4.0 9.2 (Critical); Oracle and the OpenJDK advisory rate it CVSS v3.1 8.1 (High).12
The flaw affects OpenJDK 17.0.6 and later (17, 21, 25, and 27 lines) and every distribution built from it — Oracle Java SE, Amazon Corretto, Eclipse Temurin, Microsoft Build of OpenJDK, Azul Zulu, BellSoft Liberica, SAP SapMachine, and Red Hat OpenJDK. Exploitation additionally requires an x86-64 CPU with AVX-512 VBMI support (Intel Ice Lake or newer Xeon; AMD Zen 4 or newer); ARM64 hosts are not affected.34
Calif demonstrated pre-auth RCE against Keycloak, Atlassian Jira, Atlassian Confluence, JFrog Artifactory, Jenkins, and PingFederate in default configurations, and post-auth RCE against Apache Kafka Broker, Apache Solr, Elasticsearch, Gerrit, and Spinnaker. A Java program that merely opens a TLS connection to a malicious server can be compromised via a client-side variant. There is no universal exploit: each target needs a bespoke profile with a decoder route, heap layout, and feedback path.5
The bug
The vulnerability sits in HotSpot’s x86-64 Base64 intrinsic — hand-written assembly that C2’s JIT substitutes for java.util.Base64.Decoder on AVX-512 VBMI hardware, and only on that hardware. The intrinsic uses evmovdqub (VMOVDQU8) with a 64-bit write mask derived from the input length and the number of = padding characters. For malformed tails like X=, ==, or ===, the output-length calculation underflows to -1 or -2; the mask then degrades to all-ones, and a full 64-byte vector is written into a 50-byte result buffer. The trigger is 64 A characters followed by one = (128 on OpenJDK 17):
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=Java eventually throws IllegalArgumentException on the invalid input — but the 62 bytes written past the buffer’s end have already corrupted neighboring heap objects.6
The write itself is mostly uncontrolled (fixed bytes, including constant 0x9a), so Calif upgraded the primitive in stages, reusing a classic JavaScript-engine technique: overwrite a neighboring buffer’s length field to build a chosen-value linear write (the writer), then corrupt another array to build a heap-disclosure primitive (the reader). Before any code execution, the chain already yields a Heartbleed-style leak of Java heap contents — credentials, keys, tokens. From there the chain repairs damaged objects to keep the JVM alive, mounts data-only attacks, and escalates to arbitrary writes reaching the Code Cache for code execution.7
Remote heap grooming rides G1’s region structure: send a request up to the critical allocation, wait for TCP acknowledgement, then send the rest — giving the attacker allocation-order control without local access. The attack is sensitive to RTT and jitter, and a reverse proxy that buffers whole request bodies (nginx’s default) removes the release timing for some profiles — but not a general mitigation, since single-request targets like Elasticsearch still fall.8
The memory-safety irony
Java’s headline security property is memory safety, and this bug does not contradict it — it locates its boundary. The JVM enforces memory safety for Java code, but the intrinsics that make hot paths fast are hand-rolled assembly living outside those guarantees. The same pattern held for php2shell: PHP’s engine guarantees are enforced by C and assembly code that can itself fail. “Safe” languages are safe only down to the layer where the runtime stops being written in them.9
AI-assisted discovery
Researcher Quang Luong found the bug by directing OpenAI’s Codex at OpenJDK’s JIT compiler, intrinsics, and crypto — about an hour of prompting and triage to the finding, two more hours to a first working exploit, under $200 in tokens. Most early Codex findings were unusable; the win came from persistent prompting plus a tooling investment (a heap tracer/visualizer feeding the agent heap state, and reusable exploitation pipelines) that made later application-specific chains nearly autonomous. Calif frames this as the “centaur hacker”: AI supplies the search and generation horsepower, the human supplies target selection and judgment.1011
This is the same lab, and the same method, behind php2shell — two data points for the agentic-offensive-techniques trend and for the compressed patch-to-exploit window Amazon’s MadPot analysis flagged during PHP2Shell: when a patch or advisory drops, AI-assisted weaponization now measures in hours, not weeks.
Attack surface as accumulated code
Calif’s advisory closes with a structural argument: the Base64 intrinsic ships to every Java deployment to speed up a few high-throughput decode workloads, and everyone else inherits its risk — a tragedy of the commons in shared runtimes. Their proposed remedy, “vibe-uncoding,” is to use the same AI-assisted auditing capacity to find and delete dead code and needless optimizations (they cite Squidbleed, a Heartbleed cousin in Squid’s FTP module since 1997) rather than only to find bugs in what ships. A runtime flaw beneath millions of unrelated applications is a common-mode-failure in exactly the sense the PHP2Shell analysis used.12
Mitigation
Patches shipped November 17, 2026 in Oracle’s Critical Security Patch Update and the OpenJDK advisory release; updating is the only complete fix. Interim mitigations, x86-64 hosts only:
-XX:-UseBASE64Intrinsics— disables hardware-accelerated Base64 encode/decode-XX:UseAVX=2— disables AVX-512 code paths entirely (broader performance cost)
The -XX:UseAVX=2 flag is not recognized on ARM and will prevent the JVM from starting there. Linux hosts can check exposure with:
grep -m1 '^flags' /proc/cpuinfo | tr ' ' '\n' | grep -E '^(avx512f|avx512bw|avx512vbmi|bmi2)$'All four flags must appear for the vulnerable code path to be reachable.13
Related
- php2shell — the same researchers’ October 2026 RCE pair in the PHP engine; same shared-runtime common-mode structure, same AI-assisted method
- agentic-offensive-techniques — AI-assisted vulnerability discovery and exploit development as an offensive capability
- common-mode-failure — one runtime defect beneath millions of otherwise-diverse applications
- cyber-losses-vs-ai-capabilities — whether AI-era critical CVEs move aggregate damage or only the schedule
Sources
- Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere
- OpenJDK Vulnerability Advisory: 2026/11/17
- Lawrence Abrams 2026 — Critical Java4Shell flaw allows RCE attacks on major Java applications
Footnotes
-
Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere ↩
-
Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere ↩
-
Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere ↩
-
Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere ↩
-
Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere ↩
-
Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere ↩
-
Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere ↩
-
Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere ↩
-
Lawrence Abrams 2026 — Critical Java4Shell flaw allows RCE attacks on major Java applications ↩
-
Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere ↩
-
Quang Luong (Calif) 2026 — Java4Shell: Write once, RCE everywhere ↩