Hacker News new | ask | show | jobs
by AgentME 18 days ago
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)
5 comments

This isn't the best flag to mitigate, since it will fail on systems that don't support AVX2.

I recommend -XX:-UseBASE64Intrinsics instead.

What system supports AVX512 but not AVX2?
I assume that the advice is referring to situations where you might have a mixture of ARM and AMD64 hosts, like on AWS, so you need to be careful about global flag updates that might not work across all instances.
Surely you'd still need to know what you're deploying on. Can't plop an x86_64 JVM on an ARM host or vice versa, at least if you want them to run.
I think the idea is that you’re already running the appropriate JVM on each architecture, but want to push a global command line flag update to every JVM you run, regardless of architecture, that prevents this exploit.

Until, presumably, there’s fixes and you can test, update etc.

Why'd you patch the commandline of JVMs that aren't vulnerable though?
It's possible if you have enough abstraction layers. At my company there are a few systems with Java runtime flags specified in the service source code, but deployment configuration in a separate infrastructure-as-code repository. Switching between CPU architectures is normally transparent if you don't rely on native code libraries.
Which is a common enough thing if you're picking Java or an interpreted language.
That’s what docker base images are for so don’t count on these two concerns being colocated.

If it’s Java, Node, etc the binary dependencies are platform specific and 100% if your code is not unless you try very hard.

That's where you're wrong buddy /s

https://github.com/elide-dev/madura

Just a compiler, but a runner isn't impossible.

Other option we have been using for few months https://github.com/adoptium/adoptium-support/issues/1480#iss...
If a system doesn't support AVX512, is it an issue?
AFAICT: No.

Edit: If I understood the article correctly, the machine needs to have all the four of these flags in order to be exploitable: avx512f, avx512bw, avx512vbmi, bmi2

There are presumably more bugs lurking in the hand crafted assembly intrinsics in the JVM. The many eyeballs and shallow bugs thing is only true when the eyeballs actually understand the code.
Tony Hoare we miss you already.

There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies.

Oddly enough they saw fit to mention this fact in TFA.
(This comment subthread was moved from an HN thread on an earlier article about the vulnerability before much information was out.)
Crazy!
I've seen some more detailed writeups, but HN doesn't seem to allow linking to them, so ... :shrug: