SSHole OpenSSH Password Bypass on Alpine and How to Fix It
How CVE-2026-123158 lets a long password log in to passwordless accounts on musl builds of sshd without PAM, how to check a host or container, and the fix.

On 5 November 2026 the OpenSSH project shipped Portable OpenSSH 10.6p2 with a one-paragraph security note: a password authentication bypass in sshd on some Linux systems built and run with PAM disabled, most visibly those using the musl C library. The bug became CVE-2026-123158, the security community started calling it SSHole, and CISA added it to the Known Exploited Vulnerabilities catalog on 9 November with a remediation due date of 12 November. That is four days from publication to "attackers are using this".
The short version: on an affected sshd, any password between roughly 257 and 1024 bytes logs in to an account whose shadow password field is a single *. On Alpine Linux that includes root on a stock install, every key-only user created without a password, and the alpine user in the official cloud images. This post walks through why that happens, which hosts and containers meet the conditions, how to check yours from the shell, how to patch, and what to do on a box you cannot patch today.
What the bug is
The CVE record is short and precise. The MITRE entry for CVE-2026-123158 says sshd in OpenSSH before 10.6p2 on Linux, when musl libc is used without PAM, "lacks a workaround for a password authentication bypass", and that for some account configurations any password between 256 and 1024 characters succeeds. MITRE scores it CVSS 3.1 8.1 with high attack complexity, because the attacker needs a particular account layout on the target. CISA files it under CWE-394, Unexpected Status Code or Return Value, which is the most useful label of the lot: the whole bug is one function returning an error value that looks exactly like data.
The OpenSSH maintainers put it carefully in the commit message: they do not consider the root cause to be inside OpenSSH, but they were well placed to avoid it. Both halves of that are true, and the reason is in how sshd checks a password when PAM is not in the picture.
How sshd checks a password without PAM
Most Linux distributions build sshd with PAM and set UsePAM yes. The password then goes to PAM, PAM goes to pam_unix, and sshd never compares a hash itself. Alpine is different. Its default openssh-server package is built without PAM (there is a separate openssh-server-pam package for people who want it), so sshd falls back to its own code path in auth-passwd.c.
That path, sys_auth_passwd(), does three things:
Reads the stored password field for the user from the shadow file.
Hashes the password the client sent with
crypt(), using the stored field as the salt.Accepts the login if the result is byte-for-byte equal to the stored field.
Step 2 has a wrinkle. A stored field of * (or anything too short to be a real hash) is no use as a salt. For that case the portable code in openbsd-compat/xcrypt.c has a helper, pick_salt(), which walks the password database and borrows the salt of the first account that has a modern $id$salt$hash entry. The intent is sensible: hash every attempt the same way, so a passwordless account does not answer faster than a real one and leak which accounts exist.
So for a user whose field is *, sshd ends up calling crypt(attempt, "$6$someone_elses_salt") and comparing the result to *. With a correct crypt(), the output is a long SHA-512 string that can never equal *, and the login fails. That is the invariant everything rests on.
Where musl breaks the invariant
musl's crypt() refuses keys that are too long. The Alpine advisory states that musl returns the literal string * as its error indicator for keys longer than 256 bytes. That return value is legal: crypt() implementations have long signalled failure with a string that can never match a real hash, and * is a traditional choice for exactly that reason.
The trouble is that * is also the traditional value of a shadow password field for an account that has no password. Put the two together:
| Input | Value |
|---|---|
| Stored shadow field for the target account | * |
| Salt actually used | borrowed $6$ salt from another account |
| Password sent by the client | 257 to 1024 bytes of anything |
What musl crypt() returns | * (the error string) |
| What sshd compares | "*" == "*" |
| Result | authenticated |
The 1024-byte ceiling comes from sshd itself: auth-passwd.c defines MAX_PASSWORD_LEN as 1024 and rejects anything longer before it reaches crypt(). The 256-byte floor is musl's. In between, every password is the right password.
Two preconditions in the advisory fall straight out of this. The target account must have * as its field, because that is what the error string is compared against. And at least one other account must have a $5$ or $6$ hash, because without one pick_salt() falls back to a short default salt and the long-key error path that returns * is not reached. The advisory sums the risk up in one line: one account with a password is enough to expose every account without one.
glibc does not behave this way, and with PAM in charge sshd does not run this comparison at all. That is why the same OpenSSH release on Debian, Ubuntu, Fedora or RHEL with their default PAM configuration was never exposed. Ubuntu's CVE tracker marks every supported release not affected.
The fix in 10.6p2
The upstream change is commit 4353fdc, titled "avoid password authn bypass". The part that closes the hole is two lines in sys_auth_passwd():
+#define MIN_PASSWORD_HASH_LEN 4
#define MAX_PASSWORD_LEN 1024
@@
- return encrypted_password != NULL &&
+ ret = encrypted_password != NULL &&
+ strlen(pw_password) >= MIN_PASSWORD_HASH_LEN &&
strcmp(encrypted_password, pw_password) == 0;A stored field shorter than four characters can never be a valid hash, so sshd now refuses to treat a match against it as success, whatever crypt() returned. *, !, x and !! all fall under that floor. The rest of the commit is memory hygiene: shadow_pw() now returns a copy that callers free with freezero(), so the stored hash does not linger in memory after the check.
This is the kind of fix that does not depend on musl changing anything. Any crypt() that returns a short sentinel on error, on any libc, now fails closed.
Who is affected
The Alpine advisory lists the conditions, and all of them have to hold:
sshd is the
openssh-serverpackage (built without PAM), oropenssh-server-pamrunning withUsePAM no.PasswordAuthenticationisyes, which is the OpenSSH default.At least one account has
*as its password field.At least one other local account has a
$5$or$6$hash.
Affected Alpine branches are 3.21 to 3.24 and edge, plus the unsupported 3.16 to 3.20. Accounts with a * field are more common than people expect. Alpine has shipped root:* since about 3.16, although PermitRootLogin prohibit-password stops password logins for root by default. Users added with adduser -D for key-only access get * too, as do directory-service users resolved through musl-nscd.
The case that bites hardest is the official tiny-cloud images. The advisory says images from 3.18.11 through 3.24.3 ship an alpine user with a * field and passwordless doas. They are safe on first boot, because no account has a real hash yet. The moment anyone sets a console password, or user-data writes a hashed_passwd, the alpine user becomes reachable with a long password, and doas turns that into root.
Not affected: containers that do not run sshd at all, any sshd with PasswordAuthentication no, openssh-server-pam with UsePAM yes, accounts locked with !, and systems with no $-style hash anywhere.
Check a host from the shell
Start with the package. Alpine backported the fix into each branch's existing version, so ssh -V still prints the old upstream number. The apk revision is what tells you whether you have it.
apk list --installed openssh-serveropenssh-server-10.0_p1-r10 x86_64 {openssh} (SSH-OpenSSH) [installed]That example is a 3.22 host one revision short of the fix. The fixed revisions from the advisory are:
| Alpine branch | Fixed openssh package |
|---|---|
| edge | 10.6_p2-r0 |
| 3.24 | 10.3_p1-r2 |
| 3.23 | 10.2_p1-r1 |
| 3.22 | 10.0_p1-r11 |
| 3.21 | 9.9_p2-r1 |
| 3.20 | 9.7_p1-r6 |
| 3.19 | 9.6_p1-r3 |
| 3.18 | 9.3_p2-r4 |
| 3.17 | 9.1_p1-r7 |
| 3.16 | 9.0_p1-r6 |
The matching point releases are 3.21.10, 3.22.8, 3.23.8 and 3.24.4. Note that 3.21 reached end of support on 1 November 2026, four days before the bug went public. It got a fixed package anyway; do not count on that next time.
Next, confirm the binary really is linked against musl. On a source build or a non-Alpine musl distribution this is the line that matters:
ldd /usr/sbin/sshd | head -1 /lib/ld-musl-x86_64.so.1 (0x7f3c1a2b4000)The load address will differ on your machine. A path containing ld-musl means musl; a libc.so.6 line means glibc and you can stop here.
Then ask sshd for its effective settings. sshd -T prints the configuration after every include and default has been applied:
sshd -T | grep -E '^(passwordauthentication|usepam) 'passwordauthentication yesThere is no usepam line in that output, and that is itself the answer. sshd only prints usepam when it was compiled with PAM support. On the plain openssh-server package the option does not exist, so the binary is on the vulnerable code path whenever password authentication is on.
sshd -T on its own ignores Match blocks, and a Match block is a common place for PasswordAuthentication yes to hide. Test the connection context that matters:
sshd -T -C user=deploy,host=office.example.test,addr=203.0.113.10 | grep '^passwordauthentication 'passwordauthentication yesFinally, look at the account layout. These two commands list the accounts with a * field and the accounts with a SHA-256 or SHA-512 hash:
awk -F: '$2 == "*" { print $1 }' /etc/shadow
awk -F: '$2 ~ /^[$][56][$]/ { print $1 }' /etc/shadowroot
deploy
adminRead that output as two lists: root and deploy from the first command, admin from the second. Your account names will differ. If both lists are non-empty and the earlier checks matched, the host is exploitable until it is patched.
Check containers and images
Containers that run sshd, usually for CI runners, SFTP drop boxes or "SSH into the app" debug images, are the part of the estate people forget. Check a running one without opening a shell in it:
docker exec sftp-gateway apk list --installed openssh-serveropenssh-server-10.3_p1-r1 x86_64 {openssh} (SSH-OpenSSH) [installed]That one is on 3.24 and one revision behind 10.3_p1-r2. Running apk upgrade inside the container and restarting it works as a stopgap, but the change disappears the next time the container is recreated from its image. The real fix is to rebuild from a patched base, for example alpine:3.22.8 or later on that branch, and redeploy.
Patch and restart
On a host, the upgrade is the standard Alpine pair, and the restart is not optional:
apk upgrade -U -a
rc-service sshd restartapk upgrade replaces /usr/sbin/sshd on disk, but the daemon already in memory keeps running the old code until it restarts. Each new connection is handled by a fresh sshd process forked from that listener, so an un-restarted host stays vulnerable after a "successful" upgrade. Existing SSH sessions survive the restart on OpenRC, so this is safe to run over SSH.
If you cannot patch today
Turn password authentication off. It removes the vulnerable code path entirely, and on most servers it should have been off already. First confirm that key login works in a second session and keep your current session open. Then add a drop-in:
PasswordAuthentication noAlpine reads sshd_config.d by default from 3.19 onward. The file name starts with 00- because sshd uses the first value it sees for most options, so the earliest file wins. On older releases, or where the main sshd_config sets the option inside a Match block, edit those lines too, because a later Match block can switch passwords back on for the users it matches.
Validate before you restart. sshd -t checks the configuration and prints nothing when it is valid:
sshd -t && rc-service sshd restart
sshd -T | grep '^passwordauthentication 'passwordauthentication noThe rc-service line also prints OpenRC's own status lines, which are omitted here. If you need passwords for a few users, a narrower mitigation is to give every * account a locked field instead (passwd -l writes !), but that touches account data on every host and is easier to get wrong than one config line.
Look for signs it was used
The advisory's detection advice is a log search. sshd logs every successful password login, and on an affected box a password login for an account that has no password is a contradiction:
grep 'Accepted password for' /var/log/messagesNov 6 03:12:44 web1 auth.info sshd[2231]: Accepted password for alpine from 198.51.100.23 port 51122 ssh2The host name, process id and address in that line are an example. An Accepted password entry for alpine, root or any key-only user is the indicator to act on. For containers that run sshd -D -e, the same line goes to the container log, so search docker logs instead. Then review doas use, new users, changed authorized_keys files and anything new in cron. The advisory's guidance is blunt and right: if you cannot rule out a login, treat the system as compromised and rebuild it.
What SSHole teaches
The interesting thing about this bug is that no single component is wrong in isolation. musl is entitled to return * on failure. Shadow files are entitled to use * for "no password". sshd's salt borrowing exists for a good reason. The failure is that an error value and a data value share a representation, and the comparison that sits between them cannot tell which one it is looking at. The fix adds the check that should have been there regardless: a stored value that cannot possibly be a hash never authenticates anyone.
The operational lesson is about defaults. A key-only server with PasswordAuthentication yes left on "because nobody has a password" was always one account change away from trouble. SSHole made that one account change silent. Turning password authentication off on every server that does not need it, and checking that with sshd -T -C rather than by reading the config file, would have made this a non-event.


