Yah I was trying to figure out why you would have ssh installed in a container that likely gives you console access through a hypervisor (i.e docker) and then have that ssh server exposed to the internet…hummm
Oh, forgive me; I did not see that this was the selfhosted community. I almost made the mistake of assuming anyone here might know how computers work! I will strive to do better moving forward, thank you for your patience.
checked on my phone, there are a few system users with !* as their password, from what i can tell ! blocks all logins and is not bypassed by this exploit, but their shell is set to /sbin/nologin anyways.
The default firewall rules of nura block ssh from mobile data, so only wifi and usb connections would be affected if at all.
Everyone should disable ssh password auth anyways, using the phones often short pin for ssh is not secure.
I used to run SFTPGO in a container as a NAS type service. Their default image is based on Debian, but they offer Alpine versions. Password authentication is enabled by default.
The “are you affected?” section directly contradicts this. It outright states you must have password authentication enabled. Otherwise, SSH never gives you a chance to even attempt a password.
I think there is some confusion and potential for misinformation here. SSH in key-only mode (common configuration) protects you from this problem, because it never accepts or even attempts any passwords at all, regardless of length. SSH in password-allowed mode with at least one user who might be a key-only USER by merit of having a password hash of “*” (not a valid password hash) is a prerequisite for this. That is a very different and very common thing, as most systems come with at least one key-only user by default. But gaining access to that user with an incorrect, invalid password still requires having passwords enabled at all.
To be clear: Password access enabled is a prerequisite, and by extension, password access disabled (key-only) prevents this.
The website you linked clearly defines that all of these conditions must be true for you to be vulnerable, and as far as I can tell, it is exactly correct:
is your sshd running on musl? (alpine, openwrt, buildroot, yocto)
is it not using pam? alpine’s openssh-server doesn’t by default, or maybe you set UsePAM no are password logins still on? they are by default
is there an account with just * as its password? key-only users, ldap users, root on alpine
and some other account with a real password?
then that * account takes any password between 257 and 1024 characters
The * account which they suggest potentially being “key only” is the prerequisite you are talking about, but having SSH itself key-only (which is best practice anyway) prevents the attack entirely.
Correct, password authentication must be enabled on the SSH daemon side of things to be vulnerable. The user account being logged into, on the other hand, can't have a password set. But overall, PW auth must be on. The website OP linked is exceedingly bad at explaining the actual problem, see Alpine's announcement for better info.
Yes, it was a stroke of genius to label their mediocre confectionery as “coffee”, although it can lead to near fatalities when someone who’s only ever had Starbucks encounters real coffee for the first time.
Still, my point stands. That website is like 20% useful content, 40% flair, and 40% wasted space.
“Cyber” ppl love to do this. This is basically their resume I guess? They have to sensationalize absolutely everything they can (not that this isn’t an important bug, but this could have been a 1-2 page white paper imo (like many of them))
I’m no cybersecurity expert, but from what I’ve heard from those who are, this is the new normal as anyone who formerly had no chance due to being a “script kiddie” can now just prompt an AI* to eventually find a vulnerability.
The irony - of course - is that their 401k money goes right into hacking those same people’s 401ks.
… but at least we can brainrot an entire generation with glass fruit slices and put artists out of work?
Now if you’ll excuse me, I have to go convince someone that the TikTok deepfakes they’re watching aren’t real and that cops don’t really employ nanny-boo-boos to unsettle criminals during interrogations. No, I’m not joking.
It’s not quite as simple as that. The author in this case followed a pretty specific trail to find the bug.
Where AI helped was as the last step. They already knew what the bug would do and where to look, but actually looking through the source code for all the possible musl implementations out there would have taken a lot of time.
So they brute-forced it instead and asked AI to spin up actual running instances of all those implementations and simply tried the bug against each of them, rather than looking at all the code.
Ah I agree it’s easier to hack. What I don’t agree with is the notion that it enables a class of people that couldn’t hack before. It’s easier to hack, yes, but for the same people who were hacking before.
Ignorant people trying to use ready-made tools for hacking isn’t a new thing, it goes back a while, there’s even a term for it (script kiddies).
Yes, and that’s what I disagree with. Neither AI nor scripts will make a script kiddie into an actual hacker.
“AI makes hacking easy” is like saying “building houses is now easy because we have cranes”. Sure, but if you jump into a crane without knowing what you’re doing it’s not magically going to make a house appear.
Fair enough; at least we’re on the same page as far as what we disagree about.
Your metaphor strays too far from the topic to be relevant. Here’s one that I believe is closer and makes your position look as silly as you made mine look:
“AI makes hacking easy” is like saying “ovens make cooking easy” when fires exist.
Many more people who couldn’t or wouldn’t cook before don’t have to worry about measuring or guessing temperature, manual cook times, setting up a cooking surface, etc. Does the meal cook itself? Obviously not - you still need a recipe and plenty of manual effort.
The way it works is that finding vulnerabilities required a lot of technical understanding and mental effort. A software could have a glaring hole in it for years without anyone finding out simply due to nobody really looking. AI just gives you the ability to do rudimentary exploit analysis around the clock without having to spend your own time. This is a wake up call to anyone making software in sloppy fashion.
But it isn’t quite as easy as saying “AI hack into this service”, if the person doing the hacking is using the same model as the person who made the service, and that person already asked the AI to do that and fixed the resulting exploit prior to release.
Even projects that use AI in a limited fashion to code or even not at all, often use AI to at least do some red team stuff prior to release.
I don’t really foresee any way this doesn’t even out eventually.
You’d think that but so far I haven’t seen an actual PoC exploit for the PHP vulnerability that doesn’t require misconfiguring the server. And this is over a week after the patches were released.
If I’m running containers on Alpine, doesn’t that mean that they already don’t offer SSH (sshd)? The entire point of Alpine as a base is to not add stuff you don’t need.
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:
Fewer Letters
More Letters
Git
Popular version control system, primarily for code
LXC
Linux Containers
NAS
Network-Attached Storage
SSH
Secure Shell for remote terminal access
4 acronyms in this thread; the most compressed thread commented on today has 10 acronyms.
That’s a really bad check unless you have an external box receiving logs and you’re looking there, because the first thing that a sophisticated attacker is going to do if they get in as root is remove the signs of their presence.
The only container i have that has a reachable SSH port is forgejo, and even then it’s only local traffic and i’d have to check if it even uses alpine. All others also don’t have SSH enabled.
This isn’t nearly as bad as I thought it was. Also the author is very reliant on AI to the point where they didn’t think about what if someone wipes the logs.
Any effected devices should be wiped and redeployed
People use * as an account password, or sysadmins allow that? I’d never allow that on any system or service of mine. No surprise, like most of these LLM discovered issues in the media lately, it hasn’t come up before. 💯 Good they’re getting fixed, but nothing so far has really been that urgent to fix for me.
Nah the hash function gives up after 256 bytes and outputs *, matching the ‘hash’.
Edit: it’s unix tradition to put * as the hash for system accounts that should never be able to be logged in, this bug now means you can login (with the right config), using any password longer than 256 characters.
But how is that better than just disabling a user’s ability to log in with a password through the normal notation I mentioned? Just not sure why that was used at all. Is it something that some installer or distribution does by default? Why would that be used?
I use alpine with an ssh port exposed to the internet so I can connect to it. This doesn’t seem to be an issue if you configured your settings to be secure.
The container thing is extremely unlikely. However, having worked with developers before, I know there are people who are running those AWS and Azure images with internet-facing SSH password authentication. If they hadn’t already been hacked, they’ve all been hacked now. Somebody just had to check Shodan for hosts in those IP ranges running OpenSSH and try a few usernames.
I’ve been setting UsePam = no for decades because leaving it on meant that it’d still present a password login of keys failed. Is this still the case, was I wrong from the beginning, or is this somehow ok?
I’m not following. Are you saying you login with ssh keys and not the password, but leave “UsePam = no” so then if ssh fails you don’t have a pam error?
It’s been years since I was experimenting, trying to set things up properly, but at the time I could swear that I’d have the following set:
PubkeyAuthentication yes
PasswordAuthentication no
UsePam yes
and attempts to SSH into the system would still result in a password prompt, even though PasswordAuthentication was set to no. After some experimentation, I found that if I set UsePam to no, you wouldn’t get a password prompt, so that’s what I’ve been doing on every SSH server I’ve had since like, 2000.
Tinkering with it now though, I see there’s also another directive, KbdInteractiveAuthentication, which when set to no, will ensure I don’t see a password prompt even when UsePam is set to yes. I can only assume that 26ish years ago there was no KbdInteractiveAuthentication, or I just didn’t know about / notice it!
Well no harm done in my case anyway, as I don’t generally expose SSH servers to the outside world anyway. But it’s good to know that I don’t have to turn off PAM to disable password logins anymore.