# Java4Shell: Malformed Base64 in OpenJDK Triggers Remote Code Execution

Original title: Java4Shell: RCE in OpenJDK when processing Base64

> Hacker News story 50538240 · language: en · submitted 2026-11-17
> Web version: https://zeli.app/story/50538240
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 1155 · by [werrett](<https://news.ycombinator.com/user?id=werrett>) · 💬 321
[original](<https://calif.io/java4shell/>) · [HN discussion](<https://news.ycombinator.com/item?id=50538240>)

## Summary

A researcher auditing OpenJDK HotSpot found that the x86-64 Base64 intrinsic miscalculates its store mask on padded input, causing an out-of-bounds heap write. By grooming the heap remotely and corrupting array lengths, the fixed-byte overwrite becomes a heap leak (dubbed JavaBleed) and then arbitrary writes reaching the Code Cache for code execution. Exploitation requires per-target profiles and stable network conditions, so it is not a universal point-and-shoot.

## Key quote

> I came looking for copper and found gold, through sheer persistence. But wait, is it really gold, or just fool's gold?

## HN discussion (321 comments)

### [lucasluitjes](<https://news.ycombinator.com/item?id=50539499>)

> From the section on performing heap grooming over the network ("Remote Heap Feng Shui"):
>
> \> The current attack is sensitive to network conditions, like RTT and jitter. Low, stable round-trip times are preferred for a more reliable attack. In our controlled environment, we performed this attack over the internet through public IP addresses instead of just assuming perfect laboratory conditions. For the current attack path to achieve optimal stability and reliability in exploitation, Calif turned to physics and utilized money to solve the problem, rather than experimenting with TCP/IP stack configuration. In other words, Calif rented another VM in the same region as our target.
>
> And the "Limitations" section:
>
> \> There is no universal payload. Each chain needs a decoder route, a live writer, a returned reader or another feedback path, a heap layout, and an application action. Every target needs a bespoke profile. The exploit is not a universal point-and-shoot.
>
> Based on the complexity and constraints, short-term mass-exploitation seems unlikely. It will take some time before there are reliable exploits, and they may require running on infra close to the target.
>
> But a long tail of unpatched java applications/services at high-value targets getting exploited, seems plausible to me.

### [ievans](<https://news.ycombinator.com/item?id=50538391>)

> Super impressive work by Calif as usual.
>
> The exploit conditions are very specific but there are still going to be a lot of hosts impacted. We at Semgrep published some free detection scripts here: https://github.com/semgrep/detection-scripts/tree/main/CVE-2...
>
> They look for these five conditions:
>
> \* HotSpot VM: any OpenJDK build, Oracle JDK, or GraalVM JDK. Only HotSpot generates the stub. OpenJ9 and GCJ are OK. Azul Prime (Zing), which replaces C2 with its own JIT, and any VM name not recognized as HotSpot are [?], never [!].
>
> \* x86-64 JVM on an x86-64 host.
>
> \* Version 17.0.6 or later, not at or above a version listed in FIXED_IN, and no newer than the newest releases checked (see below). Newer versions are [?]: they may carry the fix.
>
> \* The JVM reports avx512_vbmi and avx512bw, and UseAVX >= 3.
>
> \* Base64 intrinsics are on and C2/JVMCI can compile. These turn it off: -XX:-UseBASE64Intrinsics, -XX:DisableIntrinsic=_base64_decodeBlock, -Xint, -XX:TieredStopAtLevel below 4.

### [leca](<https://news.ycombinator.com/item?id=50538337>)

> What’s that old Chinese proverb? “May you live in interesting times”? It feels like we’re living in interesting times. How long will it take for a bad actor to seriously compromise critical infrastructure? My bet is within six months.
>
> The upside is that it’ll force legacy institutions and organizations with sub-par security to get good at security and modernize their legacy stacks. That, or get pwned in short order.

### [AgentME](<https://news.ycombinator.com/item?id=50538205>)

> Unconfirmed, but people on Twitter suggest this vulnerability has to do with the AVX512 implementation of Base64 decoding, and so this vulnerability can be worked around by running Java with the -XX:UseAVX=2 flag. (https://x.com/sean_a_cassidy/status/2122791344573976817)

### [fsnovask](<https://news.ycombinator.com/item?id=50539855>)

> \>The best hacker today is neither AI nor human. It is the centaur hacker, part human, part AI.
>
> I think only really smart people are going to be left in Security and Software. I can barely fathom what this group is doing with AI right now (ignoring that their model probably isn't nerfed and mine would be) and I don't think any of this is trainable for the average developer. This is starting to feel like some of the scientific fields where careers start when you get a MS/PhD. Or like the average developer is on the same level of not being able to convert a Word document to PDF.

### [drum55](<https://news.ycombinator.com/item?id=50538933>)

> They aren’t wrong that we should be deleting more support and removing more features. The idea that the linux kernel by default builds support for all sorts of ancient systems nobody has ever heard of is absurd.

### [yabones](<https://news.ycombinator.com/item?id=50538586>)

> Before you keep your security team up all night, it looks like proxies save the day here. Might not be a complete fix, obviously a real patch should be applied as soon as possible.
>
> \> Request streaming. Some current grooming profiles need partial request bodies to reach the application. A proxy that waits for the complete body removes their release timing. nginx buffers request bodies by default.
>
> https://calif.io/java4shell/#limitations

### [mzs](<https://news.ycombinator.com/item?id=50538403>)

> You can also mitigate Java4Shell by starting OpenJDK with either:
>
> -XX:-UseBASE64Intrinsics to disable hardware-accelerated Base64 encoding and decoding, or
>
> -XX:UseAVX=2 to disable AVX-512. Apply this flag only on x86-64 hosts. OpenJDK on ARM doesn't recognize it and will fail to start.

### [jrmg](<https://news.ycombinator.com/item?id=50546819>)

> Their video of the exploit in action would be stronger if it was a bit more straightforward.
>
> All the (impressive!) distracting graphics, the speed of change, and the lack of commentary meant it took me a few watches to actually notice the ‘seashell’ segments were wrapping remote shells that the exploit had given them.
>
> https://youtu.be/-EOYmL4UKvs

### [nacnud](<https://news.ycombinator.com/item?id=50538543>)

> More info here: https://www.upwind.io/blog/java4shell-what-we-know-now-and-w...
>
> It's a heap out-of-bounds write in Java’s AVX-512 Base64 decoder.

---

## Cite

- Page: https://zeli.app/story/50538240
- Date: 2026-11-17
- Source: calif.io (https://calif.io/java4shell/)
- Hacker News: https://news.ycombinator.com/item?id=50538240

## Other languages

- zh: https://zeli.app/zh/story/50538240 · markdown: https://zeli.app/zh/story/50538240.md
- ja: https://zeli.app/ja/story/50538240 · markdown: https://zeli.app/ja/story/50538240.md
- ko: https://zeli.app/ko/story/50538240 · markdown: https://zeli.app/ko/story/50538240.md
- de: https://zeli.app/de/story/50538240 · markdown: https://zeli.app/de/story/50538240.md
- es: https://zeli.app/es/story/50538240 · markdown: https://zeli.app/es/story/50538240.md
- ru: https://zeli.app/ru/story/50538240 · markdown: https://zeli.app/ru/story/50538240.md
