example.com/path/to/article
000 points · username · 0 hours ago
example.com1186 points · 339 comments · 5 days ago · werrett
lucasluitjes
ievans
The exploit conditions are very specific but there are still going to be a lot of hosts impacted. We at Semgrep published some free detection scripts here: https://github.com/semgrep/detection-scripts/tree/main/CVE-2...
They look for these five conditions:
* HotSpot VM: any OpenJDK build, Oracle JDK, or GraalVM JDK. Only HotSpot generates the stub. OpenJ9 and GCJ are OK. Azul Prime (Zing), which replaces C2 with its own JIT, and any VM name not recognized as HotSpot are [?], never [!].
* x86-64 JVM on an x86-64 host.
* Version 17.0.6 or later, not at or above a version listed in FIXED_IN, and no newer than the newest releases checked (see below). Newer versions are [?]: they may carry the fix.
* The JVM reports avx512_vbmi and avx512bw, and UseAVX >= 3.
* Base64 intrinsics are on and C2/JVMCI can compile. These turn it off: -XX:-UseBASE64Intrinsics, -XX:DisableIntrinsic=_base64_decodeBlock, -Xint, -XX:TieredStopAtLevel below 4.leca
The upside is that it’ll force legacy institutions and organizations with sub-par security to get good at security and modernize their legacy stacks. That, or get pwned in short order.
AgentME
fsnovask
The best hacker today is neither AI nor human. It is the centaur hacker, part human, part AI.
I think only really smart people are going to be left in Security and Software. I can barely fathom what this group is doing with AI right now (ignoring that their model probably isn't nerfed and mine would be) and I don't think any of this is trainable for the average developer. This is starting to feel like some of the scientific fields where careers start when you get a MS/PhD. Or like the average developer is on the same level of not being able to convert a Word document to PDF.
drum55
yabones
Request streaming. Some current grooming profiles need partial request bodies to reach the application. A proxy that waits for the complete body removes their release timing. nginx buffers request bodies by default.
mzs
-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.
nacnud
It's a heap out-of-bounds write in Java’s AVX-512 Base64 decoder.
Noe2097
jrmg
All the (impressive!) distracting graphics, the speed of change, and the lack of commentary meant it took me a few watches to actually notice the ‘seashell’ segments were wrapping remote shells that the exploit had given them.
benjiweber
exabrial
(Re-reading my comment, sounds like I'm throwing shade. I was just trying to state a fact. In fact most of the third party distros have been caught off guard).
hypfer
Genuine question. Everything I see is Intel all the time. I know that people at home switched to AMD, but they don't run enterprise java.
I also have been told that apparently EPYC was hyped for a while and some hosters give you that. But do corporations run the java applications there?
The name makes it sound like Log4J or the PHP thing, but from what I can tell right now, it kinda isn't all that relevant?
ozgrakkurt
Is it difficult to just go through Java, nodejs etc. Base64/hex/.. implementations and fuzz them all?
Does anyone know why this would be missed?
secondcoming
Validark
Should say "output_len & 0xFF >= 64" instead. Bzhi only looks at the bottom byte.
sabretooth1405
kaliszad
sundaramohan
george_max
Could this be what triggered the recent outages?
rbanffy
mooreds
Bummer that:
The Eclipse Foundation is not in the Vulnerability Group (despite their request to join), so we do not get weeks of advance notice regarding CVEs and patches (which would essentially allow us to build & test in advance of an embargo being lifted, and deliver on hour zero).
Dwedit
zkmon
Their first priority is not stabilizing the tech tent. They are busy planning the risk distribution, risk outsourcing, legal prep, customer messaging, ToS/SLA reviews, contracts etc. They are reinforcing the good-old fort walls around the tech tent.
jeffbee
This is something I really like about LLVM. Their libc isn't spilling over with hand-written assembly. It's written in straightforward C++ under the belief that the compiler does, or will do, a good job.
iririririr
plmpsu
cedricbonhomme
dboreham
[deleted]
tomekb
bitlad
DataDaemon
thayne
ajasmin
djha-skin
It took our own Quang Luong an hour to discover the vulnerability, and two more hours to develop the first working exploit. The total token cost was less than $200.
I don't know, man. I just don't know.
spidermonkey23
yossufyahia
Ikersl
doctorpangloss
giiiiiit
titzer
Our incredibly high tower of Jenga blocks is falling down under its own weight.
So many promotions because of optimizing cosmically unnecessary work, though.
Derp, derp, this is humans making computers.
As a person who does these kinds of optimizations, it hits in the feels.
mushufasa
DarkmSparks
now panicking in case some LLM imported this without me noticing.
edit: it did. :(
stevefan1999
These mainstream CPU families meet the hardware requirements:
Intel Xeon: Ice Lake, Sapphire Rapids, Emerald Rapids, Granite Rapids AMD EPYC and Ryzen: Zen 4 or newer
Guess I don't have to do anything. All of my servers run on last gen hardware, on Zen 2 anyway.
ethagnawl
Also, (S)FTP is dead? Since when?
bullen
http://move.rupy.se/file/base64.txt
If this part becomes the bottleneck; so I need to write a GPU accelerated version I'll eat my own hat.
badgersnake
Woodi
But there is part of article that somehow nobody mentions ! "A call for vibe-uncoding" and that is a future and sane sanity. How many unused Linux modules laying on disk ? And more commercial systems are usually worse - installer just unpacks and declares warranty void if something is modified or removed - law enforced stupidity.
You have [open] code ? You can clean it by doing very coarse work of not calling unused code or hardcoding return error on calling unused parts.
Like FTP code. Open source IT declared it dead years ago but camera and game manufacturers and probably more industries didn't get a memo. Still we do not implemented ftp replacement and ssh is single point of failure.
theteapot
cowlevel
TutleCpt
voidUpdate
"It is the centaur hacker, part human, part AI."
AI is... a horse?
LastTrain
f646993e074382f
nikanj
Why do we even pay for Ubuntu?
seanieb
cpach
[deleted]
migf
[deleted]
9029
brightbed
To speed up Base64 decoding…
But. Just. Why. Maybe just KISS.
SoraTakai
[deleted]
Sigmazero60
ghm2199
This attack is pretty insane to me for a couple of reasons. That intrinsic implementation is compiler/runtime dependent. There are many implementations of JVMs out there that could be vulnerable.
The other scary thing is that there are likely other intrinsic implementations which hide vulnerabilities that are hard to know without further research.
tesnorindian
[deleted]
aaronvg
eyalitki
spullara
EGreg
https://github.com/Qbix/proxy/blob/main/java4shell.md
When PHP2shell was announced, before the patches were available, I wrote a proxy to sanitize input. You should have an input-sanitizing proxy in front of your app servers anyway instead of waiting for patches for as-yet-undiscovered CVEs.
PHP < 8 doesn't have patches coming. It's either the proxy or be pwned. Some our honeypot machines running PHP 5 got infiltrated with full chained kernel-level exploits. The ones with the proxy didn't. Which one do you want to be?
https://github.com/Qbix/proxy -- now updated to help mitigate java4shell
Having said that, my proxy approach wouldn't fully protect ALL Java apps in this case, because:
A Java program that opens a TLS connection to a malicious server can be compromised, even if it exposes no service of its own.
The problem is that you can't intercept and "heal" TLS connections with a proxy, unless you also spoof the TLS certificates. However, since most Java apps don't pin certs, a workaround is using /etc/hosts and a CA cert added in cacerts. Then the proxy approach works even on outbound traffic. And you don't have to wait for the patches.
1. Add maliciousserver.com -> 127.0.0.1 (or proxy IP) in /etc/hosts
2. Java app resolves the hostname, connects to your proxy on 443
3. Proxy presents a cert for maliciousserver.com signed by your local CA
4. JVM checks: right hostname, trusted CA? handshake succeeds
5. Proxy connects to the real server (using its own resolver that bypasses /etc/hosts, or the real IP directly)
6. Normalizes Base64 in the response (assuming Calif relies on a wacky base64)
7. Relays to Java client (safe)
so what you'd do is: 1. Generate proxy CA cert
2. Install in JVM truststore (keytool)
3. /etc/hosts entries for known hostnames
4. forward_proxy config block (port, ca_cert, ca_key)
5. You have three options for routing:
HTTPS_PROXY env,
JVM flags (-Dhttps.proxyHost),
or iptables REDIRECT (covers code that ignores proxy vars)
6. Start qbixproxy
7. Verify with curl
The usual disclaimers... lock down the executable, removing any ability to read or write files, only pass traffic through like a proxy. Investigate the repo yourself, with your own Claude or ChatGPT etc. The repo even has links to pre-fill the prompts to do just that.I'm putting this out under MIT license to help people, but under this license it disclaims all warranties, including implied warranty for merchantibility etc.
The current attack is sensitive to network conditions, like RTT and jitter. Low, stable round-trip times are preferred for a more reliable attack. In our controlled environment, we performed this attack over the internet through public IP addresses instead of just assuming perfect laboratory conditions. For the current attack path to achieve optimal stability and reliability in exploitation, Calif turned to physics and utilized money to solve the problem, rather than experimenting with TCP/IP stack configuration. In other words, Calif rented another VM in the same region as our target.
And the "Limitations" section:
There is no universal payload. Each chain needs a decoder route, a live writer, a returned reader or another feedback path, a heap layout, and an application action. Every target needs a bespoke profile. The exploit is not a universal point-and-shoot.
Based on the complexity and constraints, short-term mass-exploitation seems unlikely. It will take some time before there are reliable exploits, and they may require running on infra close to the target.
But a long tail of unpatched java applications/services at high-value targets getting exploited, seems plausible to me.