r/java • • 5d ago

Calif discloses Java4Shell flaw in OpenJDK's Base64 decoder

https://runtimewire.com/article/calif-discloses-java4shell-flaw-in-openjdk-s-base64-decoder
128 Upvotes

13 comments sorted by

39

u/SleeperAwakened 5d ago

This is really really bad, we have some patching to do!

Better to link to the source!

https://calif.io/java4shell/

10

u/pronuntiator 5d ago

The last paragraphs about reducing the attack surface by removing unneeded features are ironic given the low adoption of the Java module system which would allow for that. Wouldn't help in this particular case, but in general.

8

u/Siedlerchr 5d ago edited 5d ago

But only if you accept payload on a server and you need to have specific hardware

  • Intel Xeon: Ice Lake, Sapphire Rapids, Emerald Rapids, Granite Rapids
  • AMD EPYC and Ryzen: Zen 4 or newer

17

u/TomKavees 5d ago

Or deal with jwt, or connect to a site where somebody else controls the tls certificate, or...

I get your point, but base64 used pretty much everywhere.

3

u/anyOtherBusiness 4d ago

I understood both must be true. So you’re running under the vulnerable Hardware and decode base64 somewhere in your app.

-4

u/Siedlerchr 5d ago

I wonder if it can still be exploited if you run your stuff inside a Docker container.

17

u/TomKavees 5d ago

Of course, container is just a bunch of kernel namespaces, it doesnt restrict access to cpu instructions

-9

u/detroitsongbird 5d ago

Yes. Claude it, there’s a startup flag that’ll work to resolve this until the JDKs get updates.

3

u/yoden 5d ago

Nope

also shared a client-side exploit with us. A Java program that opens a TLS connection to a malicious server can be compromised, even if it exposes no service of its own

1

u/simon_o 4d ago

The client still needs server-level hardware or a new Ryzen.

1

u/kiteboarderni 5d ago

its really really not.

14

u/TomKavees 5d ago edited 5d ago

Looks like this can be mitigated by command line switches, so it's not as catastrophic as the title suggests

Edit: tl;dr of sorts - per https://calif.io/java4shell/

Recommendations

OpenJDK released a security advisory and Oracle released a patch at 1:00pm PT on Nov 17, 2026.

All Java users should update immediately.

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.

1

u/starkake 19h ago

I went through description. So, in order to do something:
- you need to find app that has base64 public endpoint
- run specific version of CPU
- has specific jdk/jre (sadly this is the weakest point)
- create attack that will build some portion of memory by invoking a lot of requests to that endpoint
- if there is traffic to that service memory complexity of the attack goes up
- if there are more than one instance or restart you are starting from scratch or need much higher traffic to that endpoint
- there is no actual shell you can start out of the box.
Am I reading this wrongly? I mean, strategy “patch, don’t panic” should be applied in my opinion here 🤷‍♂️ and honestly it looks like normal buffer overflow bug. We had millions of those in libs already. Nothing like log4shell…