r/programming • • 11d ago

Java4Shell: RCE in OpenJDK Base64 (Calif)

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

45 comments sorted by

View all comments

Show parent comment

4

u/Primary_Ads 10d ago

yikes

17

u/bwainfweeze 10d ago

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

10

u/n00bz0rz 10d ago

What's your second least favourite HTTP header?

16

u/bwainfweeze 10d ago

Referer. Particularly when paired with Referrer-Policy.

7

u/Vakz 10d 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 10d ago

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

2

u/bwainfweeze 10d 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.