
Imagine you're filling ice-cube trays from a pitcher. Each tray has a known number of slots. But someone miscounted the slots on the last tray, and you pour 64 cubes' worth of water into a tray that only holds 50 — the overflow floods the counter, soaking whatever's sitting next to it. That's the core mechanism here: OpenJDK's x86-64 Base64 intrinsic miscalculates a write mask for the tail of the input, and 14 bytes of overwrite spill into adjacent heap memory. The pitcher is the AVX-512 VMOVDQU8 instruction. The ice-cube tray is the allocated decode buffer. And 'whatever's sitting next to it' is whatever object the JVM's G1 garbage collector happened to place there. The committed claim: on affected OpenJDK builds (confirmed on JDK 21 and JDK 17), a crafted Base64 input string ('A' * 64 + '=' on JDK 21, 'A' * 128 + '=' on JDK 17) triggers a constant-value out-of-bounds write of up to 14 bytes past a 50-byte heap buffer. Through remote heap feng shui — controlling allocation order via carefully timed HTTP requests — the author escalates this to arbitrary heap read (dubbed 'JavaBleed'), arbitrary heap write, and ultimately remote code execution by corrupting the JVM's Code Cache. The vulnerability lives in HotSpot's C2 JIT compiler, specifically in the intrinsic that replaces java.util.Base64 decoding with hand-tuned AVX-512 assembly. When the remaining input is fewer than 64 bytes and contains padding ('='), the code computes output_len by dividing input length by 4 and multiplying by 3, then subtracting padding bytes. For degenerate inputs like a single '=' or '==' alone, output_len underflows to -1 or -2. The subsequent bzhiq instruction, which is supposed to create a bitmask with output_len bits set, treats any value >= 64 as 'set all bits.' The result: a 64-bit mask of all 1s is passed to evmovdqub, which dutifully writes all 64 bytes of its vector register to the destination buffer — a buffer that was only allocated for 50 bytes. The overwritten bytes are not attacker-controlled in value — they're fixed at 0x9A for bytes 48-63. This looks unexploitable at first glance. But the author borrows a classic JavaScript engine technique: spray the heap with arrays whose metadata (specifically, their length field) sits at a predictable offset from the decode buffer. When the overwrite corrupts that length field, the array believes it's larger than it actually is, granting a bounded linear write over neighboring objects. Place another array after that, corrupt its length too, and you get an arbitrary read primitive — data from the heap leaks back into HTTP responses. That's JavaBleed: PII, session tokens, private keys, all readable before any code execution occurs. The remote exploitation chain is methodical. First, warm up the Base64 decoder so C2 compiles the vulnerable intrinsic. Second, perform 'Remote Heap Feng Shui' — send partial HTTP requests, wait for TCP ACKs to confirm allocation ordering, then complete the requests to trigger the vulnerability with the heap in the desired state. The technique is sensitive to network jitter and RTT; the author openly notes they rented a VM in the same cloud region as the target to get stable timing. Spray-and-pray handles the remaining non-determinism: multiple writer/reader array pairs are allocated so at least one lands adjacent to the decode buffer. Notably, the author credits Codex (OpenAI's code model) with finding the initial vulnerability during an audit of JIT intrinsics, cryptography, and widely-accessible APIs. Most of Codex's early findings were 'slops' — unreachable or impractical. The Base64 bug survived triage. During exploit development, an AI agent also assisted with heap grooming but got stuck, requiring a custom heap tracer/visualizer built by human expertise. This is a concrete data point in the 'AI-assisted vulnerability research' debate: the AI found the needle, but a human built the magnet and threaded it. The implications are broad. Base64 decoding is everywhere in Java server stacks — authentication tokens, API payloads, certificate handling, image uploads. Any Java application running an affected OpenJDK build on x86-64 hardware with AVX-512 support that decodes attacker-supplied Base64 input is in the blast radius. The title 'Java4Shell' invokes Log4Shell for a reason: the attack surface is similarly ubiquitous, though the exploitation complexity is significantly higher.
The analogy
Imagine filling ice-cube trays from a pitcher. Each tray has a known number of slots, but someone miscounted the last tray's capacity. You pour 64 cubes' worth into a 50-slot tray — the overflow floods whatever's sitting on the counter next to it. The pitcher is the AVX-512 VMOVDQU8 instruction, the tray is the allocated decode buffer, and the counter is adjacent heap memory.
Ice-cube overflow
Pouring 64 cubes into a 50-slot tray because the slot count was miscalculated from a bad label
AVX-512 mask bug
Writing 64 bytes via VMOVDQU8 into a 50-byte buffer because bzhiq on underflowed output_len produces an all-ones mask
Honest assessment
This is a genuinely novel exploit class: memory corruption inside the JVM's own JIT-compiled intrinsics, reachable through the most mundane of inputs (Base64 strings). The exploitation chain is complex — requiring heap grooming, stable network timing, and spray-and-pray — which limits mass exploitation but not targeted attacks. The AI-assisted discovery angle is the most important meta-signal: if Codex can find one intrinsic bug through 'prompted persistence,' systematic audits of all ~300 HotSpot intrinsics are now viable. The real question isn't whether this specific bug gets patched — it will — but whether this is the first cockroach.
What Is CLAIMS?
83
/ 100
BedrockNews applies a structured analytical framework called CLAIMS to academic papers and technical research releases.
How CLAIMS worksClaim
5/5
Ladder
4/5
Architecture
5/5
Integrity
4/5
Milestone
3/5
Successor
4/5
What is this paper actually committing to?
Genuine first: a remotely exploitable memory corruption in the JVM's own Base64 intrinsic, not in application code or libraries. The attack surface — Base64 input — is near-universal in Java servers.
The field fight
Are JIT compiler intrinsics — hand-tuned SIMD assembly for performance — a systematically under-audited attack surface in managed runtimes?
Side A
Managed runtimes are memory-safe by design; intrinsics are small, well-tested hot paths
Held by: JVM security model, enterprise Java consensus
Side B
Intrinsics bypass the safety guarantees of the managed runtime and are audited far less than application-level code; SIMD complexity makes mask/length bugs likely
Held by: This paper, browser JIT security researchers, Project Zero
Milestone tracker
Unlocks: Understanding whether this is a one-off or a class of bugs across all managed runtimes with SIMD intrinsics
Current
1
intrinsic exploited
Base64 (this paper)
Next
10+
intrinsics audited
Systematic SIMD audit
~6-18 months if methodology is adopted by other researchers
Verified Facts (8)
On JDK 21, trigger input is 'A' * 64 + '=' (65 bytes); on JDK 17, it is 'A' * 128 + '='
The allocated buffer is 50 bytes; the write is 64 bytes starting at offset 48, yielding a 14-byte out-of-bounds overwrite
Bytes 48-63 of the overwrite are fixed at value 0x9A
The vulnerability is in HotSpot's C2 JIT compiler x86-64 Base64 intrinsic using evmovdqub (VMOVDQU8)
output_len underflows to -1 or -2; bzhiq(-1, output_len) with output_len >= 64 produces mask == -1u64 (all bits set)
The author credits Codex (OpenAI) for finding the initial vulnerability
Remote exploitation was demonstrated over the internet via public IP addresses, not localhost
The author rented a VM in the same cloud region as the target for stable RTT
Practical Implications (5)
Any Java service accepting Base64 input on affected OpenJDK builds with AVX-512 hardware is in the blast radius — patch immediately when fix ships
Even before RCE, the heap-read primitive ('JavaBleed') can leak PII, session tokens, and private keys from Java heap memory
Security teams should inventory which JDK versions and hardware their Java services run on; AVX-512 presence is the hardware prerequisite
The AI-assisted audit methodology demonstrated here will be replicated by other researchers and by attackers; expect more intrinsic bugs to surface in 2026-2027
Defense-in-depth: WAFs that reject degenerate Base64 inputs (e.g., inputs consisting mostly of '=' padding) can mitigate the specific trigger
More latest news
Read all