r/programming • • 7d ago

Java4Shell: RCE in OpenJDK Base64 (Calif)

https://calif.io/java4shell/
321 Upvotes

45 comments sorted by

105

u/HipstCapitalist 7d ago

I cannot imagine the impact if this affects Minecraft servers...

42

u/siromega37 7d ago

Every. Single. One.

20

u/Sopel97 7d ago

do they decode untrusted base64?

46

u/bwainfweeze 7d ago

There’s an http header that uses base64

4

u/Primary_Ads 7d ago

yikes

17

u/bwainfweeze 7d ago

My least favorite HTTP header too so it's really lemon juice on the papercut.

10

u/n00bz0rz 7d ago

What's your second least favourite HTTP header?

16

u/bwainfweeze 7d ago

Referer. Particularly when paired with Referrer-Policy.

7

u/Vakz 6d ago

Mine's https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Date, primarily used in https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After#syntax. Who thought "Wed, 21 Oct 2015 07:28:00 GMT" was a reasonable way to do timestamps primarily read by code and not people?

6

u/CornedBee 6d ago

Wait, Apache httpd isn't just lots of Native Americans reading requests and writing responses?

2

u/bwainfweeze 6d ago

Encoding aside, the brilliance of the Date header is that it cancels out most of clock skew between the client and the server.

When HTTP 1.0 was new, we still had computers with CR-2032 batteries on the motherboard to run a clock while the computer was off, and I ran into so many people while doing tech support whose computers thought it was January 2, 1970 because they'd not once thought to replace that battery.

When the server tells you that the document expires on Thursday and it's currently Wednesday, you know how long to keep it for, even if you think it's Tuesday at the moment.

So the two ends of the link can nail down clock skew to a little more than the speed of light delay between them, and Berners-Lee thought of this problem sometime back around 1990. It is actually my favorite header because of that.

I know I used this on one project to solve a particularly hairy consensus problem but I can't remember which, now.

9

u/OffbeatDrizzle 6d ago

99.99% yes. especially when the connections are tls encrypted. java uses it under the hood extensively, and even if you don't use it in your own code directly, you are probably using / hooking into a library that does (knowingly or otherwise)

you should assume that every java app that accepts user input is vulnerable

2

u/sshwifty 6d ago

Assume any app that accepts input is vulnerable.

7

u/CpnStumpy 7d ago

How I miss the days of BO. Simpler times.

7

u/GinaBun 6d ago

From what I have audited so far, it seems that the only attack surface here is server -> client via favicon, could not find any client -> server at all.

19

u/hff0 7d ago

so it doesn't affect jdk8, gtk

9

u/ponton 6d ago

finally not upgrading pays off

4

u/OffbeatDrizzle 6d ago

that's why I run windows xp without a firewall...

unrelated, but does anyone else's computer get randomly encrypted daily?

6

u/RapunzelLooksNice 6d ago

It is a security feature, BitLocker Premium.

41

u/siromega37 7d ago

Anonymous RCE is bad. The fact that Oracle can’t tell us when they’ll have a fix is worse. Hope no one has tableau exposed to the web.

28

u/colablizzard 7d ago

The article mentions fixes released.

8

u/irregularjosh 6d ago

Still waiting for a Temurin 21 fix

Until then I need to add some command line arguments to Jira and Confluence before I get a security team breathing down my neck tomorrow

3

u/Mclarenf1905 6d ago

The CVE was report intentionally withheld until Nov 17th the same day as the November Java Security release, which is pretty normal. Temurin tends to lag behind by about 2 days because it takes them that long to build the various releases after pulling down the changes from the opendjk upstream. Coretto tends to have the fix out in a few hours to a day because they can throw a lot more compute at it.

-1

u/colablizzard 6d ago

Then this researcher was being reckless.

1

u/0f_rice_and_men 5d ago

How can you tell if that is affected?

https://status.salesforce.com/generalmessages/20000275

These are only specific CPU architectures affected

23

u/SlaminSammons 7d ago

This is such a specific setup that needs to occur that this really isn’t a massive deal. So of course there will be some sort of panic at people’s job caused by executives who know nothing.

9

u/crunchmuncher 6d ago

such a specific setup

Could you elaborate a bit on that? The article led me to believe that the list of very common software in default configuration running on a common JDK are vulnerable to RCE.

5

u/OffbeatDrizzle 6d ago

OP talking out their ass. even if they don't think they're doing a base64 decode, there is no guarantee that a library they're passing input into does not

3

u/SlaminSammons 6d ago

I’d recommend reading datadog’s analysis. It describes it pretty well. DOS is easy to exploit through this, but RCE requires far more specific setups.

https://securitylabs.datadoghq.com/articles/java4shell-remote-code-execution-in-openjdk-cve-2026-114938/

4

u/OffbeatDrizzle 6d ago

such a specific setup? like... modern hardware? lol

1

u/Impossible_Break698 6d ago

Going through that right now. Nothing I can say or do will prevent them from understanding the attack vector doesn't exist for a particular vulnerability they are panicking over.

6

u/Comic_Melon 7d ago

I'm tired boss

-1

u/TCB13sQuotes 7d ago

No worries, PHP sucks, Java is perfect this is not a problem. :)

10

u/pixartist 6d ago

You know php can suck without Java being perfect

-10

u/st4rdr0id 7d ago

Someone please ELI5 why are these bs intrinsics (BASE64, CRC32, SHA, Adler32) even allowed? I know I know, there are like 300 intrinsics, I'm referring only to the untrusted ones. These JIT assembly tricks on RWX pages... they defy the entire point of having a VM security-wise. Someone please create -XX:UseUntrustedStuff encompassing all the new untested stuff until proper verification is conducted on them. This RCE should also push the need for AOT plus static binary verification whenever possible.

11

u/bwmat 7d ago

I don't think there's anything inherently unsafe about the intrinsics used here, it's just that using them involves hand written assembly, and that's risky because humans

-2

u/pickle9977 7d ago

Correction it’s risky because computers are risky as they interface between the probabilistic and the exact and nothing is perfect.

Humans have nothing to do with it, we are the most perfect part of a computing system by orders of magnitude

1

u/entronid 6d ago

this specific problem is a human problem though

-18

u/owen800q 7d ago

can AI like claude code help me to patch it?

0

u/[deleted] 7d ago

[deleted] — view deleted comment

49

u/induality 7d ago

It’s tongue-in-cheek.

84

u/BoppreH 7d ago

Might be a reference to the viral video where the "cyber correspondent" admits he had just learned what PHP was.

0

u/[deleted] 7d ago

[deleted] — view deleted comment

35

u/CherryLongjump1989 7d ago edited 7d ago

We're talking about serialization in Java, right? Which is infamous for horrible performance.

Who was using enough base64 that they needed that hand tuned?

Literally HTTP Basic Auth headers, MIME/email attachments, binary blobs inside JSON, Kafka, gRPC payloads, every serialized token or cookie. The hot path for auth and API gateways.

So as long as you don't use Java for any of the things that everyone uses Java for, you're probably fine...

0

u/[deleted] 7d ago

[deleted] — view deleted comment

6

u/CherryLongjump1989 6d ago edited 6d ago

Base64 is re-chunked binary data. You split up your binary data into 6 bit segments and pad them with 2 more bits to get a byte. It's one of the main ways you can shove incompatible binary formats into other binary formats, and it just so happens to fall into the range of ASCII characters. So it's extremely versatile and efficient whenever you have to transfer binary data across a wide variety of protocols, without having to to transcode at every step of the way. So in other words it's ideal for anything network related.

11

u/bwmat 7d ago

Base64 is everywhere these days due to json/xml-based serialization