OpenJDK x86-64 Base64 intrinsic can overwrite heap memory
Original title: Java4Shell: Write once, RCE everywhere
A bad padding mask makes a 64-byte write; one trigger allocates a 50-byte buffer and writes from offset 48.
A writeup says OpenJDK HotSpot's x86-64 Base64 intrinsic miscalculates the padded-tail store mask, so a masked vector store can write 64 bytes after the output length underflows. The author says remote heap shaping can turn that fixed overwrite into a heap leak and remote code execution. On OpenJDK 17 the trigger string is longer. The excerpt states no patch and no confirmed attacks outside the research.
Unconfirmed: The excerpt states no CVE, fix, or attacks outside the author's research.
- A 65-byte input of 64 A's plus '=' is said to allocate a 50-byte buffer.
- On OpenJDK 17 the stated trigger is 128 A's plus '='.
- Bytes 48 through 63 of the uncontrolled write are always 0x9a.
- Only the landing position of the out-of-bounds write is controllable, the author says.
Impact: Out-of-bounds heap write the author says can become RCE
| Product | Affected |
|---|---|
| OpenJDK HotSpot | affected OpenJDK builds; OpenJDK 17 trigger differs |
From the original article
10 min read at calif.io
On affected OpenJDK builds, malformed Base64 data can cause a constant-value overwrite of allocated heap memory. Through remote Heap Feng Shui, we turn that overwrite into a heap leak and remote code execution. A few months back, I was developing a 0-click exploit on a certain phone vendor.
By calif.io via unlobito · calif.io
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.