r/linux • • 22d ago

Discussion SSHole: A long password could bypass SSH authentication on affected Alpine Linux systems

A recent OpenSSH security issue caught my attention, especially because of how unusual the authentication bypass is.

The vulnerability, known as SSHole (CVE-2026-123158), affects certain Linux systems running OpenSSH with musl libc and without PAM support.

What's happening?

Under specific conditions, an attacker with network access to the SSH service can authenticate to an account that has no password configured by sending an unusually long password.

The reported password length is between 257 and 1,024 bytes.

This is particularly concerning because some accounts are intentionally configured for SSH key-based authentication only.

Which systems are affected?

The issue is configuration-dependent. The main affected combination includes:

- Linux systems using musl libc.

- OpenSSH built without PAM, or configured with PAM disabled.

- Password authentication enabled.

- Accounts with no password set, alongside at least one account with a supported password hash.

Alpine Linux is a notable example because its standard OpenSSH server package uses this configuration.

Important: This does not affect every OpenSSH installation. Systems using glibc, non-Linux systems, and configurations using PAM for password authentication are not affected by this issue.

What has been done?

The OpenSSH project released version 10.6p2 on November 5, 2026, containing a security workaround.

Alpine Linux also released updated packages for affected branches, including older releases.

Administrators should:

  1. Update OpenSSH or the relevant Alpine package.
  2. Restart the SSH daemon after updating.
  3. If immediate patching isn't possible, disable password authentication using "PasswordAuthentication no".
  4. Review SSH authentication logs for unexpected access.

Why is this interesting?

A few things stand out:

- Authentication assumptions: An account intended for key-only access may still be exposed through an unexpected authentication path.

- Dependency interactions: The issue involves the interaction between OpenSSH, musl libc, and PAM configuration.

- Configuration matters: Having a secure authentication policy on paper doesn't guarantee that the underlying implementation enforces it correctly.

Question for the community

When hardening SSH servers, do you prefer completely disabling password authentication, or do you consider properly configured PAM-based authentication sufficient?

I'd be interested in hearing how others approach SSH hardening, particularly in Alpine-based containers and lightweight Linux deployments.

Sources

- "OpenSSH – Official 10.6p2 Release Notes" (https://www.openssh.org/releasenotes.html)

- "Alpine Linux – Official Security Advisory" (https://www.alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/)

- "The Hacker News – SSHole Vulnerability Report" (https://thehackernews.com/2026/11/openssh-issues-emergency-fix-for-flaw.html)

- "CVE-2026-123158 – Vulnerability Record" (https://www.cve.org/CVERecord?id=CVE-2026-123158)

Shared for defensive awareness. Only test systems you own or are explicitly authorized to assess.

54 Upvotes

53 comments sorted by

17

u/STrRedWolf 22d ago

The big thing here is that it's the combination of musl libc not returning anything for a status in the crypt() function (breaking standards) and OpenSSH not checking the return status value.

Forehead slaps, everyone! 3! 2! 1!

5

u/natermer 21d ago edited 21d ago

It is really a security flaw introduced by Alpine Linux distribution and musl. The issue is that crypt(), which is a optional part of the POSIX standard, is offered by musl.

According to POSIX spec when crypt() can't handle a input or something like that happens it is supposed to return a NULL.

https://pubs.opengroup.org/onlinepubs/9799919799/functions/crypt.html

Upon successful completion, crypt() shall return a pointer to the hashed password; the first two bytes of the returned value shall be those of the salt argument. Otherwise, it shall return a null pointer and set errno to indicate the error.

However musl returns "*" instead. This was a design choice. Nobody should ever be able to use a "*" password so this would normally make it so that it never matched.

The reason it does this is that older software can't handle the NULL, for historical reasons to do with the whole mess of USA crypto export restrictions and so on and so forth.

For that older software they will SIGFAULT instead of handling it well. This will create denial of service vulnerabilities... that is attacker could just send long strings and crash the service every time it came up. So returning "*" is just musl trying to be "helpful".

Modern Linux glibc does something similar. Since 2.36 applications use libxcrypt instead of libcrypt. This is done at linking time when applications are compiled. GNU's libxcrypt does something crucially different. It can handle virtually any length of string... and while it can return NULL and be strictly POSIX if configured to do so... it typically "*1" or "*0" for the same reason that Musl returns "*".

On a normal Linux system you can read "man 3 crypt" for the details.

OpenSSH portable is designed to be portable and can handle NULLs just fine.

So if Musl followed the POSIX spec it would of been fine. If Musl did what Glibc did it would of been fine. For systems configured to use PAM for OpenSSH it would of been fine. etc.

But because it returns "*" and "*" is what people often put into the password field in /etc/passwd or /etc/shadow to disable that account... then it passes.

Very unfortunate.

What OpenSSH did for OpenSSH portable 10.0p2 was to add a check to check for hash length. No hash should return a single character, so that effectively closes that hole.

This is probably best described as a "defense in depth" measure by the OpenSSH team to help mitigate the problems caused by Alpine Linux + Musl rather then a vulnerability in OpenSSH per say.

In a ideal world the distribution developers would be aware of weird issues like this and take it into account. But we don't live in a ideal world.

I am pointing this out because when it comes to OpenSSH in Linux... most of the time when there is a vulnerability it is something that the distributions did wrong and not really a issue with OpenSSH.

Other similar issues is when Debian created cve-2008-0166 by patching Openssh in such a way that caused very un-unique SSH keys to be generated. This made people's private keys trivial to guess.

Or with CVE-2024-3094 were Redhat-based distributions introduced a additional dependency for OpenSSH on XZ Utils. XZ Utils ended up, for a very short time period, backdoor'd by a malicious attacker that used social engineering attacks to work his way into becoming a github maintainer for XZ.

And because this is something that is a problem with Musl it likely affects other software that uses crypt(), not just Openssh...

3

u/ElvishJerricco 21d ago

I think you're being overly forgiving toward openssh, though I'd agree musl is way more at fault here. Openssh would see a user's hashed password was set to "*", and it would proceed with a password auth flow anyway. Obviously that should have failed appropriately, but taking a code path with the option to succeed at all when you know you're meant to fail is nuts.

1

u/natermer 20d ago edited 20d ago

The way I look at it is that other login software that depends on libcrypt's output would have the same vulnerability.

And this actually probably does exist somewhere. That is there a class of unix password using services that are perfectly fine on every other platform except musl.

"proceed with password flow anyways" is something that is very common to do because it prevents information disclosure through timing attacks.

Openssh got found because it is still one of those classic unix services that people still point to the internet and it is installed on virtually every Linux system out there. Yeah sure they could of done more 'security in depth' thing by not trusting system libraries that are written for this purpose, but where does that end?

(it ends with openssh project bundling everything it needs to work into its own "ssh distribution")

And the reason this isn't worse is mostly because people have largely stopped relying on Unix accounts for most popular internet service applications.

1

u/NeverMindToday 21d ago

Openssh would see a user's hashed password was set to "*", and it would proceed with a password auth flow anyway.

Their reason for proceeding with the flow was to avoid timing attacks - they just didn't expect a crypt() result to return an error sentinel that could actually match what could be in the shadow file.

eg a common interpretation from the shadow 5 man page would be that crypt() should never return "*":

If the password field contains a string that is not a valid result of crypt(3), for instance ! or *, the user cannot use a UNIX password to log in. However, the user may log in the system by other means.

I can't blame openssh for that one. But their new check for hash result length seems like a useful hardening against a crypt library doing something dumb.

1

u/ElvishJerricco 21d ago

Their reason for proceeding with the flow was to avoid timing attacks

I know that. My point was that this was an unnecessarily risky way to do it. If that flow had a bug, it would do an auth that was already known to be unacceptable. To avoid the timing attack, it should have just done the hash procedure, not the whole authentication flow.

1

u/BinkReddit 21d ago

What an awesome breakdown; thank you for taking the time to spell this out in such a easily digestible way.

34

u/ABotelho23 22d ago

I really hope a huge suite of tests were added to the affected software after this. This really should have be caught, it's barely an edge case.

24

u/NeverMindToday 22d ago

Why would tests help? Each component was doing exactly what the maintainers intended to do.

The problems stemmed from conscious design decisions not bugs - any tests would've been to ensure the software behaved as intended.

4

u/Adept_Percentage6893 21d ago

The problems stemmed from conscious design decisions not bugs - any tests would've been to ensure the software behaved as intended.

This is why "integration testing" is a thing. This isn't the first time some behavior has only cropped up in certain environments.

4

u/mina86ng 22d ago

The problems stemmed from conscious design decisions not bugs - any tests would've been to ensure the software behaved as intended.

I find that characterisation very doubtful. I cannot imagine how conscious and correct design decisions can lead to accepting long passwords as valid.

But even if that’s true, you can still have integration tests which check how combination of components behave.

19

u/NeverMindToday 22d ago

I find that characterisation very doubtful. I cannot imagine how conscious and correct design decisions can lead to accepting long passwords as valid.

It's worthwhile reading up on the exact interactions between different codebases. I never said design decisions were "correct", just intentional ones ironically where most were aimed at increasing security within the constraints of compatibility, ambiguous specs and C limitations etc.

And only one of those many decisions that need to combine was IMO actually incorrect.

OpenSSH was right to try and limit timing attacks on their hashing functions, and do so in a way that would remain in the code after compiler optimisation. musl was right to have an upper limit on password length to prevent DoS attacks. musl switching away from null to a sentinel value to avoid sloppy programs crashing is debatable, but in line with what glibc does. The main problem and dumb decision IMO was musl (unlike glibc) using a sentinel value that could appear in a shadow files hash field.

I think openssh gets unfairly associated with what is nearly all musl's fault.

Luckily though the chances of any particular system being vulnerable to this is very remote.

4

u/Adept_Percentage6893 21d ago

Why is using a sentinel value preferable to just letting sloppy programs be sloppy?

1

u/mina86ng 22d ago

Thanks for the explanation. That does make more sense.

0

u/djfdhigkgfIaruflg 21d ago

You can't test a situation you didn't imagine it could happen

1

u/mina86ng 21d ago

I really hope a huge suite of tests were added to the affected software after this.

Top comment says about present and future.

1

u/djfdhigkgfIaruflg 21d ago

The tests are written by human beings. I can do 100% test coverage of something. But if a given possibility didn't cross my mind, then there's no way I would have writen a test.

2

u/ABotelho23 21d ago

Fuzz testing would have definitely caught this. This vulnerability was a combination of valid configuration, and a rather mundane test case (a password length higher than 256 characters).

I mean after all, the person who found it wasn't really doing any crazy tests. Pretty standard for highly secure software.

1

u/juhotuho10 18d ago

end to end fuzzing would have caught it

3

u/booveebeevoo 22d ago

Yeah I am still baffled that people trust libraries so much. Sending in a long password is one of the first things people check. You know it’s been exploited plenty. Why would the devs never test against this? It’s almost a joke.

30

u/KnowZeroX 22d ago

Because it only effects musl and you need to disable PAM, most don't use musl and PAM is on by default

12

u/Manbeardo 22d ago

And you need to be using OpenSSH. Dropbear is the more common SSH implementation for musl systems.

0

u/Sk9lA 21d ago

The question is, who is using Alpine or the few distros that uses musl and not libc ?

2

u/djfdhigkgfIaruflg 21d ago

Alpine is widely used for containers because it's trivial to make a super lightweight image with it

It's not as niche as people think

4

u/SoilMassive6850 21d ago edited 21d ago

I thought it's used as a container base image though, how many expose sshd from inside their containers? Rather than the container host which is usually something not as lightweight.

1

u/djfdhigkgfIaruflg 21d ago

I just told you it's not some random distro that nobody uses.

5

u/mina86ng 22d ago

I am still baffled that people trust libraries so much.

Because they have fewer bugs than bespoke code.

1

u/NeverMindToday 22d ago

It's not that musl isn't checking for long passwords. They deliberately are to avoid DoS attacks consuming resources by using very long passwords.

The problem is that the sentinel value "*" they return for an invalid hash result just happens to match a special case value used in the shadow file for a password disabled accounts hash value. There's more to it than that, but that's the core of it.

If they weren't checking for long passwords, this problem wouldn't have happened.

5

u/klyith 21d ago

It's not that musl isn't checking for long passwords. They deliberately are to avoid DoS attacks consuming resources by using very long passwords.

The thing is, that shouldn't be their (or that function's) job. You provide a function that hashes a string, so return the hash of that string. If a SSH program or something else that is potentially DDoS-able needs to avoid the bad effects of hashing a book-length password, they can sanitize the string themselves.

1

u/NeverMindToday 21d ago

I agree from an architectural view. That approach of protecting sloppy consuming code also lead to musl returning a sentinel rather than null for invalid results.

But I also have some sympathy for the real world desire to centralise some hardening, and I think libxcrypt makes the same decisions?

7

u/sheeproomer 22d ago

You are late to the party, the bot networks are already banging at your door since about a week.

7

u/MatchingTurret 22d ago edited 22d ago

Old news that was posted and discussed a few days ago. See https://www.reddit.com/r/linux/s/VfnbTn7nTN

5

u/Z3t4 22d ago

So you are safe if your distro uses GNU's libc.

16

u/brainchillzZ 22d ago edited 22d ago • Bravo

It was easy for people to miss and not notice but this does not affect “Linux” or “openssh” generically at all… this only affects two very specific router and firewall versions of Linux called openwrt or alpine or spinoffs pretty much who built their OpenSSh with a very specific set of libraries …. So this cve really only affects the ten neophytes that opened their alpine or wrt based firewall/router ssh up to the internet …

And for the question posed by the ops ai agent …. When hardening ssh servers yes, key based authentication, but also, obvious things like fail2ban by default and also… unless you have absolutely no other choice never, ever, leave any port open and listening to the raw unwashed masses of the internet that isn’t explicitly required (obviously if you are running a web server port 80 tcp needs to be open but it doesn’t need port 22 open to the internet)…. Firewall it to lock it down to a source ip or narrowed down source network at very least

12

u/altodor 22d ago

And it only affects openwrt if you moved off of the default SSH server, which is not openSSH.

Where I have heard that this might be a real problem, is the Azure cloud because you can spin up Alpine VMs in this configuration there.

13

u/fearless-fossa 22d ago

this only affects two very specific router and firewall versions of Linux called openwrt or alpine

Pretty much everything in this sentence is wrong. OpenWRT uses dropbear, not OpenSSH, and Alpine isn't a router/firewall, but a general purpose minimal Linux.

2

u/StuckInTheUpsideDown 21d ago

Ironically, Alpine is widely used for Docker containers because it is a minimal base filesystem and is supposed to be more secure due to the greatly reduced attack surface.

-8

u/brainchillzZ 22d ago
  1. Alpine is in use as a firewall and router all over the internet and it is used by OEM vendors in order to create appliances that do these things ... and these are the only machines that would typically be sitting on the live internet directly running embedded linux OS images ..
  2. OpenWRT uses dropbear BY DEFAULT but a hue number of people replace dropbear with openssh ... to the point that openwrt has official documentation for doing it

Know more.

6

u/fearless-fossa 22d ago

Alpine is in use as a firewall and router all over the internet

That doesn't mean Alpine is a firewall/router version of Linux as you claimed. It's general purpose, it's used as such because it's a very convenient minimal image, which is why many (if not most) container images are based on it.

but a hue number of people replace dropbear with openssh

Any source on that "huge number"? And how many of those permit password logins?

4

u/sevengali 22d ago

OpnSense and PfSense use FreeBSD, does that mean FreeBSD is a firewall OS?

Proxmox uses Debian, does that mean Debian is a hypervisor OS?

Know more.

-1

u/brainchillzZ 21d ago edited 21d ago

Alpine is built specifically to be a base os for minimal embedded appliances, that is its entire point in life. Most of those embedded appliances are firewall devices. Pretending that it is a “general Linux distribution” is silly….that is not FreeBSD’s intended purpose but still though lol if we are being honest about its install base …. I am willing to bet that by a large margin way way more people are using FreeBSD because of opensense/pfsense than for anything else so yeah I’ll bite FreeBSD is now a firewall and router os :P

2

u/sevengali 21d ago

"General purpose distribution" doesn't mean "personal computer desktop distribution". I'd bet it has been used as a container base more than a firewall anyway ;)

1

u/kansetsupanikku 21d ago

musl acts around pam as if it knew better, and it has security consequences? color me unsurprised

-1

u/UniversityMammoth653 21d ago

That's an interesting take. I think the bigger issue here is how a small difference in the way musl handles errors ended up having serious security implications. The problem wasn't simply musl or PAM, but how OpenSSH handled the unexpected return value from "crypt()". It's a good reminder that even small edge cases in authentication logic can turn into major vulnerabilities.

1

u/kansetsupanikku 21d ago

My point is that musl includes very custom implementations of pam-related features, and I don't mean crypt(), but things like users/groups/permissions too, especially in static builds with musl. It tends to break old posix contracts. Normally, it just means that your software might hit less likely paths, rather than compromise the system - when some libc based permission checks pass, but system (correctly) doesn't allow unpermitted actions. But if you build software that comes with its own pam modules with musl, it becomes so much more relevant. I doubt the recent vulnerability is the last one of the kind we are hearing about.

I see musl as a great choice for some non-system software, and as a fantastic research project. But security-wise, in production, I believe it belongs inside non-critical containers - and not because of maturity (which is of course improving), but the design.

8

u/dbear496 22d ago

The combination of "password authentication enabled" and "account with no password set" just sounds like a recipe for disaster to me.

12

u/MattiDragon 22d ago

Not setting a password means that password login is disabled. Due to a bug it treated "no password should ever work" as matching "this password should never work".

5

u/SeriousPlankton2000 22d ago

There are two variants of not setting a password, one allows log in without a password (BTDT) and one disables login.

passwd -d lusername (empty password)

vs.

passwd -l lusername (no possible password)

11

u/altodor 22d ago

Kinda? Plenty of users in Linux without passwords set though like root and www-data.

1

u/StuckInTheUpsideDown 21d ago

It's a little more subtle than that. You might have disabled password login for privileged users and enabled it for unprivileged users.

2

u/HarVVVy 21d ago edited 21d ago

.. 3. If immediate patching isn't possible, disable password authentication using "PasswordAuthentication no".

Buddy, that's not "3.", that's not even 1. That should be the first sentence in your post. Why are we being intellectually dishonest? For few precious clicks? Long term, who wins from this?

Okay then, I've got a challenge, it's 2026 - I wanna hear from everyone here who's still rocking ssh pass auth over the internet (and please share why you didn't do away with it 20 years ago, like a sane person). Who's doing that and surviving the sheer amount of bots out there? Are you clinging at fail2ban for dear life? I wanna hear from the brave souls, share your experiences. Do you also enjoy diving with sharks wearing a bloody meat-suit? Or blindfold truck driving once in a while?

1

u/imwithn00b 20d ago

AI posting