OpenSSH CVE-2026-123158: musl's error character opens accounts without a password
When sshd runs without PAM, it checks a password itself. It hashes the attempt with crypt() and compares the result with the field from /etc/shadow. If that field holds nothing but a *, as is usual for accounts without a password, sshd borrows the salt of another account so that the check takes as long as it would for a real account. For a password longer than 256 bytes, however, the musl library does not answer with a hash but with exactly that character * as its error signal. CVE-2026-123158 grows out of this coincidence, and on Alpine a single SSH connection with two password attempts is enough to get into an account that has no password at all.
TL;DR — 90 seconds
- What: sshd before OpenSSH 10.6p2 on Linux with musl and without PAM accepts, on the second password attempt within the same connection, any password between 257 and 1024 bytes for accounts with
*in the password field. The precondition is that another account has a SHA-256 or SHA-512 hash. - Severity: CVSS 8.1 according to the CVE record (
AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H), Red Hat and Amazon rate it 9.8. A proof of concept was public on the day of disclosure, the first successful attacks followed on 7 November, and since 9 November the flaw is listed in the CISA KEV catalog. EPSS stood at 95.5 percent on 22 November. - Who is affected: Alpine with the
openssh-serverpackage, which is built without PAM, and with password login enabled, as it is out of the box. Other musl systems running OpenSSH without PAM are affected as well. Glibc distributions, Amazon Linux and containers without a running sshd are not. - What to do: Upgrade the
opensshpackage to the fixed version and restart the running sshd. If you cannot do that right away, setPasswordAuthentication no. - What would have protected you: SSH with keys only via
AuthenticationMethods publickey, a list of permitted accounts, no sshd in containers and no open port 22. As a stopgap without the update,MaxAuthTries 1also works. seccomp and Pod Security do not help against this mechanism.
Two asterisks that happen to match
When a password is set, an entry in /etc/shadow contains a string such as $6$salt$hash. The number names the scheme, 6 stands for SHA-512 and 5 for SHA-256, followed by salt and hash. To verify a password, you pass it together with the stored field to crypt() and compare the result with the field. Anything that is not a valid hash blocks password login, because no output of crypt() can match it. Since the early BSD releases, the usual marker for that has been a single *.
With PAM, sshd hands this check to the PAM stack. Without PAM, it performs the check itself in sys_auth_passwd() in auth-passwd.c. That function has carried a countermeasure against CVE-2016-6210 since 2016. Back then, the response time revealed whether an account existed, because without a usable hash the rejection came instantly. Since then sshd hashes the password in that case too. If the stored field is too short to contain a salt, it calls xcrypt() without a salt, and the helper pick_salt() walks the account list and takes scheme and salt from the first account with a $ hash. sshd then still compares the result with the stored field. In his analysis, musl maintainer Rich Felker points out that sshd thereby lets the login proceed although it already knows that password login is impossible for this account.
The second half sits in the C library. POSIX says that crypt() returns a null pointer on failure. Many programs do not check for that and crash. In August 2012 musl therefore decided to return a so-called failure token instead of a null pointer, a string that is meant never to match a password. It chose *, or x if the salt passed in itself starts with *. Felker describes the guarantee precisely: crypt(pw, token) never equals token. It only holds if the caller passes the right field as the salt.
A few weeks later musl gained the SHA-256 and SHA-512 schemes. In their password variant the work grows quadratically with the length of the password, so a very long password can keep a server busy for a long time. musl therefore caps the input at 256 bytes and reports an error for longer passwords, which again means *.
This is exactly where the flaw lay. For an account with *, sshd computes crypt(long_password, $6$_salt_of_another_account), musl returns *, and the comparison with the stored * succeeds. Because sshd rejects passwords above 1024 bytes beforehand, the window is 257 to 1024 bytes. None of the decisions involved is absurd on its own. The failure token was meant to prevent crashes, the length cap a denial of service and the borrowed salt a timing leak. Only together do they yield a login without a password.
One detail is missing from the Alpine advisory, and IONIX and Medcrypt each demonstrated it independently in the lab. The first password attempt on a connection always fails. Before the fix, sshd did not read the password field as its own copy but through a pointer into the static buffer of musl's getspnam(). On its first call, pick_salt() walks the accounts, calls getspnam() again for each of them and thereby overwrites the buffer that the target account's pointer still refers to. The first comparison therefore runs against clobbered memory and fails. After that, the borrowed salt sits in pick_salt()'s cache. On the second attempt the function returns immediately, the field reads * again, and the comparison succeeds. Because every new connection gets a fresh process with an empty cache, both attempts must happen on the same connection. The first attempt can be arbitrarily short.
IONIX also describes a corner case. If the first hash found is a bcrypt hash, pick_salt() up to OpenSSH 10.6p1 copied only the prefix without the actual salt. musl rejects that setting and returns * for every password, short ones included. bcrypt hashes in /etc/shadow are rare on Alpine, but it means password length is not a reliable signal for detection rules.
Why Alpine is hit particularly hard has its own backstory. In 2019 Alpine's Docker images shipped a root account with no password at all, known as CVE-2019-5021. The correction set the field to !. Without PAM, however, ! also blocks key-based login, and cloud images depend on exactly that. Since Alpine 3.16 the base system therefore ships root:*, intended as a lock for passwords while keys keep working.
What the fix commit changes
Commit 4353fdc, titled “avoid password authn bypass”, touches three files. The actual correction is in sys_auth_passwd() in auth-passwd.c. It introduces the constant MIN_PASSWORD_HASH_LEN with the value 4. The function now reports success only if crypt() returned a result, the stored field is at least four characters long and both strings match. sshd still computes the hash for timing purposes, but a field that is too short leads to rejection regardless of the result.
The remaining changes look like memory handling but are part of the mechanism. shadow_pw() in openbsd-compat/xcrypt.c now returns a copy of the field, which the caller overwrites and frees with freezero() after use. This removes the aliasing with musl's static buffer that used to make the first attempt fail. On its own the copy does not protect anything, it would even allow the hit on the first attempt. Only the length check closes the hole. The UnixWare variant of the check in openbsd-compat/port-uw.c gets the same adjustment, and pick_salt() also cleans up the fields it scanned. The commit message states that the OpenSSH team sees the root cause outside OpenSSH but can catch the bug there.
What the fix leaves untouched is telling. The salt selection in pick_salt() and the comparison via strcmp() stay the same in substance. The only new thing is that sshd now asks the question “does this account have a hash at all?” explicitly instead of silently leaving it to the string comparison. What I derive from this: the cause was less the value * than a check path that ended open at a point where it should have ended closed. On musl's side, Felker proposes switching the failure tokens to the more common *0 and *1, and wants to assess in the longer run whether crypt() should return a null pointer with errno again. As of 23 November, crypt_sha512.c in musl's master branch still returns * as its error value, so the patch has not been merged yet.
From an overlong password to a root shell
According to the Alpine advisory, four conditions have to come together. sshd runs without PAM, that is with the openssh-server package or with openssh-server-pam and UsePAM no. PasswordAuthentication is set to yes, which is the OpenSSH default. There is an account with * in the password field. And at least one local account has a $5$ or $6$ hash, where according to Felker the first account with a password in the order of /etc/passwd has to use one of these schemes.
Accounts with * are more common on Alpine than you might think. They include root since Alpine 3.16, key-only users created with adduser without a password or with usermod -p '*', accounts from a directory service via musl-nscd and the alpine user in the official tiny-cloud images. A freshly installed system is therefore not yet exploitable as long as nobody has set a password. It becomes exploitable the moment an admin sets a console password or user data creates an account with hashed_passwd.
The attack itself needs no guessing. The attacker picks an account whose field probably contains * and sends a password with a length inside the vulnerable window. The content does not matter. Before that, they send an arbitrary first attempt on the same connection, which fails. One connection is enough, and sshd logs an ordinary successful password login. Root itself is protected by the default PermitRootLogin prohibit-password, which disables password logins for root. That helps little if another reachable account can become root. In the tiny-cloud images, alpine has passwordless doas, so the login turns straight into a root shell.
GreyNoise's observations show what this looks like in practice. The first successful attacks on its sensors came on 7 November at 00:46 UTC, about 40 hours after the fix. In its later analysis, as reported by Hackread, GreyNoise counted 18 successful attack chains from six IP addresses. The attackers examined processes and containers, queried cloud metadata services, tried to get at password hashes and root's SSH keys, and attempted to add their own keys to authorized_keys. In one case they installed a Python implant after gaining root, which never reached its command server. The metadata queries in particular show what is at stake: on an EC2 instance, the metadata service hands out the credentials of the instance role.
Truly affected are therefore Alpine hosts and VMs with an exposed sshd, containers and pods that run an sshd on an Alpine base, for example for SFTP, Git or as a jump host, and embedded systems with musl and OpenSSH without PAM. Many others only believe they are. According to Alpine, a container image based on Alpine in which no sshd runs is not affected, even if the scanner flags the openssh package. Red Hat and Amazon Linux build OpenSSH against glibc with PAM and are not affected according to their trackers. Cycode examined widely used images with an SSH server and found that Gitea, Gogs, the Jenkins SSH Agent and the linuxserver/openssh-server image disable password logins by default, the latter as long as PASSWORD_ACCESS is not set to true.
| CVE | Affected | Fix | Precondition | CVSS |
|---|---|---|---|---|
| CVE-2026-123158 (SSHole) | OpenSSH portable before 10.6p2 on Linux with musl without PAM, Alpine 3.16 to 3.24 and edge | OpenSSH 10.6p2, Alpine packages per branch | PasswordAuthentication yes, an account with *, another account with a $5$ or $6$ hash, network access to sshd | 8.1 (high), Red Hat and Amazon 9.8 |
The exploit situation is clear. According to BleepingComputer a proof of concept appeared on the day of the fix, and the SANS ISC honeypots recorded the peak of matching login patterns on 6 November with 713 attempts. CISA added the flaw to the KEV catalog on 9 November and gave federal agencies until 12 November. According to FIRST, the EPSS score was 0.98 percent on 6 November and 95.5 percent on 22 November, which corresponds to the 99.9th percentile.
OpenSSH 10.6p2 and the Alpine packages
OpenSSH released the fix on 5 November 2026 as Portable OpenSSH 10.6p2. On the same day Alpine shipped patched packages for all supported branches and also for the older branches back to 3.16, even though 3.21 has not received regular updates since 1 November. The point releases 3.21.10, 3.22.8, 3.23.8 and 3.24.4 contain the fixed package. According to the advisory, these are the following versions of openssh:
- 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
Alpine names the most important pitfall in its very first sentence. The package upgrade does not restart the running sshd, so the old process stays vulnerable until you restart it with rc-service sshd restart. You upgrade with apk upgrade -U -a. For images the same applies in a different form: a rebuilt image only protects you once the pods have been rolled out with it.
The tiny-cloud images have a second trap. According to Alpine, only images from the point releases listed above contain the fixed package. Running instances from older images therefore need an update on the instance itself, a new AMI for future launches is not enough.
If you cannot install the update right away, disable password logins. Check beforehand that your key-based login works, and keep the current session open until a new login succeeds. Alpine suggests a drop-in file under /etc/ssh/sshd_config.d/ for this, which the default configuration only reads from Alpine 3.19 on. A PasswordAuthentication yes inside a Match block can also override the global setting again. So do not rely on the file but on the effective configuration: sshd -T | grep -i passwordauthentication must print passwordauthentication no.
For legitimate operation the fix changes nothing. A field shorter than four characters cannot be a valid hash, so real passwords keep working as before. On other platforms the picture is clear. ALAS lists Amazon Linux 2 and Amazon Linux 2023 as not affected, and so does Red Hat. Wolfi is built on glibc. I did not find an entry of its own in the advisory feed, but the musl precondition is missing there. Debian lists its stable packages in the tracker as vulnerable by version number, yet builds OpenSSH against glibc with PAM and thus outside the affected configuration. If you build musl-based systems yourself with Buildroot or Yocto, you have to apply the commit yourself or move to 10.6p2.
Hardening beyond the patch
First, some context. CVE-2026-123158 is a logic error in the decision whether a login counts. There is no memory corruption, no foreign code and no unusual system call. The attacker uses the protocol's intended path and receives a regular yes. What works is therefore anything that removes the password path, limits the accounts that may log in at all, changes how locked accounts are represented, leaves sshd out where it is not needed, and limits reachability and post-login privileges. Anything that merely confines the process itself misses the point here.
Disable password login and pin the methods
The flaw lives entirely in the password path. PasswordAuthentication no switches it off, the default according to the manual is yes. More robust is the additional line AuthenticationMethods publickey. According to sshd_config(5), sshd then only offers the listed methods, so a password method that was accidentally re-enabled still stays out. Because the first match wins for keywords set in multiple matching Match blocks, you verify the result with sshd -T rather than by reading the file.
The effort lies in key management. For people, SSH certificates via TrustedUserCAKeys pay off, because you maintain one certificate authority instead of scattered authorized_keys files. For machines, keys from your secret management are sufficient.
Allow only named accounts
The attack needs an account with * that sshd accepts for login. AllowUsers or AllowGroups restrict that to a list, and sshd rejects all other accounts regardless of the password. Root, system accounts and the default user of cloud images drop out. The limit is obvious: if a permitted account itself has *, it stays vulnerable as long as password logins are allowed. The list does not replace disabling passwords, it only shrinks the attack surface. Also keep PermitRootLogin at least at the default prohibit-password, because exactly this setting protected root in this flaw.
Locked is not the same as locked
A * means “no password, keys allowed”. According to Alpine, a ! locks the account completely without PAM, keys included. Because musl only returns * or x as failure token, a ! cannot be hit by this flaw. Accounts that should never log in, such as service accounts, therefore get ! instead of *. For accounts that must log in with keys this is no solution, there disabling the password path remains the answer.
PAM instead of sshd's own password check
According to the advisory, Alpine with openssh-server-pam and UsePAM yes is not affected. The discoverer explains that PAM never even calls crypt() for a *. That is a way out for environments that truly need password logins. It does, however, add another package and another configuration layer to the authentication path that needs maintaining.
No sshd in containers
Containers without a running sshd are not affected, and in Kubernetes you almost never need one. kubectl exec and ephemeral containers via kubectl debug give you a shell through the API server, with RBAC and an audit log instead of an open port in the pod. Minimal base images such as Wolfi or Distroless contain no sshd and run on glibc as well. Where an SSH service is part of the product, for example SFTP or a Git server, check whether the image disables password logins by default.
An admission rule can additionally reject pods that declare containerPort 22. That is a heuristic, because the port can be changed and need not be declared at all. You find sshd in images more reliably through the package list, for instance via an SBOM or a CVE gate in the pipeline that flags images with openssh-server. What I derive from the mechanism: the gate finds images with the package, but not a self-built sshd that did not come through the package manager.
Limit reachability
The attack needs a connection to sshd. According to Hackread, GreyNoise counted 40.7 million scans on port 22, so an open port will be found. Security groups, firewall rules and NetworkPolicies with ingress rules that make port 22 reachable only from a management network or a bastion host take away the attack's foundation. On AWS, Session Manager works without any inbound port. Against an attacker who is already inside the network this does not help, but it shrinks the circle of possible attackers considerably.
Limit escalation after login
In the tiny-cloud images it was passwordless doas that turned the login into a root shell. Check which accounts can become root without further hurdles, and restrict doas and sudo to what is necessary. Because attackers specifically queried cloud metadata, the instance role belongs here as well: the less it may do, the less the attacker gains from access to the metadata service.
Stopgaps when the update has to wait
Because the hit only succeeds on the second attempt of a connection, MaxAuthTries 1 breaks the chain. sshd then disconnects after the first failed attempt, and a new connection starts with an empty salt cache. Medcrypt names this setting as a stopgap that keeps password logins working, while according to Medcrypt MaxAuthTries 2 is not enough. The price: rejected keys count as attempts too, so a client with several keys in its agent can hit the limit. Since OpenSSH 10.6, pure key queries do not count up to the value of max-pk-ok according to the manual, but the Alpine packages on the stable branches are older.
IONIX describes a second stopgap that keeps key logins working. Instead of * you enter a longer placeholder such as *NP*. Because the field is then longer than one character, sshd uses it as the salt itself and does not call pick_salt(), and musl returns a result that is never *NP*. Neither measure replaces the update, they only bridge the time until then.
What does not help here
sshd's seccomp sandbox limits the system calls of the authentication process, but the attack triggers no forbidden call. It receives a regular yes. For the same reason PerSourcePenalties, Fail2ban or brute-force scenarios in CrowdSec do not help, because the attack needs only one connection with two attempts, and a single successful login does not look like brute force. MaxAuthTries only helps with the value 1, the default of 6 lets the attack through. Strong passwords on other accounts change nothing either, the other account only supplies the salt and its password plays no role.
Nor do the Pod Security Standard “restricted”, dropped capabilities, runAsNonRoot and readOnlyRootFilesystem touch the login decision. An sshd in a container needs privileges to switch users anyway that “restricted” does not permit, so whoever runs one has already loosened this layer. You can read more about network boundaries, admission policies and minimal images in the series TYPO3 on Kubernetes under IT-Grundschutz.
Detection and verification
You can establish whether a system is affected in three steps. First the library: ldd on the binary shows which C library sshd is linked against, and you recognise musl by the ld-musl loader. Then the effective configuration: sshd -T shows usepam and passwordauthentication, and only the combination of usepam no and passwordauthentication yes is affected. Finally the accounts: in /etc/shadow you look for accounts with * as password field and for at least one account with a $5$ or $6$ hash. For images the package list is not enough, what matters is whether an sshd is actually listening in the running container. If you test with your own scanner, IONIX points out two pitfalls. A test with only one password per connection reports vulnerable hosts as clean. In addition, PerSourcePenalties throttles fast test series, so a disconnect before the SSH banner means “unknown”, not “safe”.
According to Alpine, the log reveals whether someone exploited the flaw. /var/log/messages then contains sshd lines with Accepted password for an account that has no password, such as alpine, root or a key-only user. sshd does not log the password itself or its length. According to IONIX, the sshd log on Alpine also does not distinguish a scanner that only checks access from an attacker running commands. What matters is therefore what happened after the login. Add the indicators Alpine names: use of doas, recently created users, new files and modified authorized_keys. I deliberately do not list concrete IoCs such as IP addresses here, because the published lists only show excerpts.
If you suspect something, Alpine's recommendation is unambiguous. If you cannot rule out a login, treat the machine as compromised. In practice that means rebuilding it rather than cleaning it, rotating the SSH keys and credentials stored on it and, on cloud instances, checking the instance role's activity in CloudTrail, because attackers queried exactly those credentials.
Recommendation for operators
Act now if an Alpine system or another musl system with OpenSSH without PAM and password login enabled is reachable from the network and any account has a password hash. Install the fixed package immediately, restart sshd and check the log for password logins to accounts without a password. If you cannot update right away, disable password logins and verify that with sshd -T. The same applies to pods running an sshd on an Alpine base.
Monitoring is enough if your hosts run on glibc, for example Amazon Linux, Debian or RHEL, or if your Alpine containers do not start an sshd. The updated package still belongs in the next image build, if only so the scanner calms down and nobody later retrofits sshd into an old image.
Regardless of the individual case, what I say about every flaw applies: patches and updates belong in automation. When Renovate or Dependabot propose new base images and package versions as merge requests and the pipeline tests them against staging, a security fix like this one is a matter of hours rather than weeks. Here every day counts, because fewer than two days passed between the fix and the first successful attack. A grace period for routine updates protects against compromised releases, and you exempt security updates from it. An automated rollout also resolves the pitfall of the daemon that was never restarted, because new pods start the new sshd fresh anyway. If you update by hand, the holiday season quickly leaves you weeks without a patch, followed by one large batch update where nobody knows any more which change broke what.
Frequently asked questions about CVE-2026-123158
My containers are based on Alpine. Am I affected?+
Only if an sshd runs inside them and password logins are allowed. According to Alpine, an Alpine image without a running sshd is not affected, even if the scanner reports the package.
Is upgrading the openssh package enough?+
Only together with a restart of sshd. The package upgrade does not replace the running process. Afterwards, check with sshd -T whether you need password logins at all.
Does PermitRootLogin prohibit-password protect me?+
For root itself, yes, this default disables password logins for root. It does not help against other accounts with *, and from there passwordless doas quickly leads to root.
What should I do after a suspicious password login?+
Treat the machine as compromised, as Alpine recommends. Rebuild it, rotate the keys and credentials stored on it and, on cloud instances, check what the instance role has done since.
Conclusion
CVE-2026-123158 is not the bug of a single line but the meeting of four sensible decisions made over forty years. An asterisk locks accounts, an asterisk signals an error in musl, a length cap prevents denial of service, and a borrowed salt prevents a timing leak. It became dangerous because one value carried two meanings and a check ended open where it should have closed. The transferable lesson: where code decides whether someone gets in, an error value must never look like a valid result, and the question “is there a secret here at all?” has to be asked explicitly. It is worth looking at your own check paths specifically for what happens when a called function fails. Equally instructive this month was the signature check in Keycloak, which verified a different message from the one it processed.
Sources
- OpenSSH 10.6p2 release notes
- OpenSSH fix commit 4353fdc
- Alpine Linux: Security advisory openssh-server password authentication bypass
- oss-security: sshole, password authentication bypass OpenSSH + musl libc
- musl mailing list: analysis by Rich Felker
- musl mailing list: patch discussion on failure tokens
- sshhole.com: write-up by the discoverer Özgün Kültekin (Wakefield)
- OpenSSH: openbsd-compat/xcrypt.c (pick_salt)
- sshd_config(5)
- Red Hat: CVE-2026-123158
- Amazon Linux Security Center: CVE-2026-123158
- Debian Security Tracker: CVE-2026-123158
- BleepingComputer: Hackers exploit SSHole OpenSSH flaw
- SANS ISC: Scans for Sshole Vulnerability
- Cycode: sshole and widely used SSH images
- IONIX: lab analysis of preconditions, two attempts and stopgaps
- WardenBit: summary of the Medcrypt reproduction and MaxAuthTries
- musl: src/crypt/crypt_sha512.c
- FIRST EPSS: CVE-2026-123158
- Hackread: GreyNoise analysis of SSHole
I check your servers and container images for SSH access with password login, move them to keys and certificates and automate the updates of your base images.
SSH audits for hosts and Kubernetes, migration to SSH certificates, admission rules and image scans for sshd in containers, update automation with Renovate and tested pipelines.
Platform operations instead of advice on paper: I continuously check, patch and harden your infrastructure.
About the author

Kai Ole Hartwig
Programming since 2002 – self-taught, set up my own business with KO-Web in 2012. Over 100 projects, with a focus on security, performance, automation and quality. Today freelance: DevSecOps consulting, training and software development.
