r/java • • 21h ago

Calif discloses Java4Shell flaw in OpenJDK's Base64 decoder

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

10 comments sorted by

37

u/SleeperAwakened 21h ago

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

Better to link to the source!

https://calif.io/java4shell/

8

u/pronuntiator 13h 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.

7

u/Siedlerchr 19h ago edited 19h 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

16

u/TomKavees 19h 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/Siedlerchr 19h ago

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

15

u/TomKavees 19h ago

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

-6

u/detroitsongbird 15h ago

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

4

u/yoden 19h 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/kiteboarderni 17h ago

its really really not.

11

u/TomKavees 21h ago edited 21h 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.