Security SSH critical vulnerability (when built and run with PAM support disabled)
https://sshhole.com/tl;dr: https://news.ycombinator.com/item?id=50380029
- sshd compiled with musl
- not using PAM
- password logins enabled
- at least one account with '*' as the password "hash"
- at least one OTHER account with a valid password
https://www.openssh.org/releasenotes.html#10.6p2
560
Upvotes
193
u/KnowZeroX 25d ago
Why highlight the PAM part in the title? It needing Musl is a bigger thing.
35
u/platinummyr 25d ago
I'm more curious on what the actual vulnerability is for curiosity sake. The twitter takes seem too gleeful about "does nobody fuzz ssh" but I am guessing it's more complicated than that... Why does it only happen on musl and yet neither does openssh consider it actually a problem in their code and also doesn't want to say it's a vulnerability in musl either...? Hmm
272
u/C0rn3j 25d ago •
Oh thank god.
Did someone's kid smash a key over and over again, again, until the login passed?
11
u/Gophy6 25d ago
Has anyone managed to make it work? It surely doesn't for me. Tried all combinations of PAM, no PAM, PAM existing but disabled, with and without root password, with and without additional user with password etc. Both /usr/sbin/sshd and /usr/sbin/sshd.pam. No combination is exploitable. Tested a bunch of several month old alpine images up to 3.12
9
u/Adept_Percentage6893 25d ago
Are there a lot of people running sshd in a container?
4
u/undead-8 25d ago
ssh exploits are important to exit the matrix.
7
u/wunderspud7575 25d ago
I think default Openwrt installs match the title.
14
u/gellis12 25d ago
Is it really a critical vulnerability if you have to take this many deliberate attempts to weaken your system before it can be exploited? This is like announcing that you've discovered a critical flaw in Medeco deadbolts that'll allow you to unlock a maximum security door; then clarifying that in order for your exploit to work, the door must be made of wet cardboard, the strike plate made of fabric, the door frame made of pasta, and the lock must also be keyed to all zero-cuts first.
The lesson here is don't disable pam, don't enable password auth, and don't go out of your way to create a new user and overwrite their password hash as "*"
2
u/MasterRaceLordGaben 25d ago
Just setup PostmarketOS on my OnePlus 3 that was slowly rotting away in a drawer to use as a homeserver. Comes with mainline kernel, systemd and Alpine packages. I was like "man haven't used musl since openwrt", lmao. Between the zstd crashing the phone, and this vuln, maybe universe is sending me a message. Literally comes with the exact setup this exploit needs out of the box.
3
u/TheOgGhadTurner 25d ago
Is this just an ad for SSHHOLE. Asshole…
1
u/gijsyo 25d ago
Did not work for me on Void with the default sshd config.
1
u/Fabiey 25d ago
Curious if this can be reproduced on Git server that can be accessed with SSH. I mean plenty of them should be running on Alpine images. Also what about OpenSSH on Windows Server?
1
u/sheeproomer 25d ago
There are already very distributed not networks scraping the internet for that.
I got since about 2-3 days a jump in attempts by the factor 20.
1
u/Zipper730 24d ago
Wait a second, does the proposed fixes require a restart for it to work? If it does, do most people involved in this realize (and have authorization) to do this?
1
u/ameer1234567890 24d ago
Alpine's concept of a minimal system for a shallower attack surface, by removing PAM modules, have backfired in this case.
1
u/Takeoded 25d ago edited 25d ago
Haven't used ssh password login since... 2006?
Great find though!
1
u/mindful999 25d ago
You should never really let SSH be accessed through passwords anyway so really just an issue for the uninformed
1
u/JGPH 25d ago
A good reason to always have a password, even with an SSH key. Not using PAM is bonkers though.
-7
u/okabekudo 25d ago
This is not even worth reporting on tbh. Not using password auth is obviously the easiest hardening step you can do, hell it's even more convenient to use pubkey auth.
-5
u/chibiace 25d ago
is this what they call AI noise?
0
u/[deleted] 25d ago
[deleted] — view deleted comment