Security News & Alerts

SSHole Technical Analysis (CVE-2026-123158): When a Locked Account Becomes the Way In

By Vince AntonioPublished 9 min read

This is the technical companion to our SSHole news post. SSHole is not memory corruption and not a race condition. It is three ordinary, documented behaviors in OpenSSH and the musl C library that line up so that an account with no usable password can be logged into. This write-up explains the root cause, shows the one-line idea behind the fix, lists exactly which systems are exposed, and gives the log signal defenders should hunt for.

A Linux administrator reading server log output on a laptop in a quiet server room

In plain English

  • On Linux systems built with the musl C library (Alpine, OpenWrt, many embedded images) and without PAM, OpenSSH could accept a login for an account that is supposed to have no password.
  • The cause is a mismatch: a failed password hash and a locked account are represented by the same single character, so a comparison that should fail instead matches.
  • Fixed in OpenSSH 10.6p2 on 5 November 2026. Alpine patched older branches without changing the version string, so check the package revision, not the banner.
  • If you cannot patch yet, turn off password authentication. Then hunt your logs for password logins to accounts that should only use keys.

At a glance

Weakness
CWE-394, an unexpected return value treated as valid (a logic flaw)
Score
CVSS 3.1 8.1 in the CVE record (AV:N/AC:H). Red Hat scores it 9.8
Fixed
OpenSSH 10.6p2, commit 4353fdc (5 November 2026)
CISA KEV
Added 9 November 2026

CVE-2026-123158 in one paragraph

CVE-2026-123158, nicknamed SSHole, is an OpenSSH vulnerability in password authentication on Linux systems that use the musl C library and do not use PAM. For an account whose password field is * (the Unix convention for "no password can match"), sshd borrows another account's stored hash to use as a salt, so that failed logins take the same amount of time as real ones. Under specific conditions musl's password hashing function fails and returns the single character "*". sshd then compares that result against the stored *, the two strings are equal, and the login is accepted. In short, the value used to mean "hashing failed" is the same value used to mean "this account is locked".

OpenSSH's release notes put it this way: "We consider the root cause of this bug to be outside sshd, but it is exploitable via sshd and can be avoided there." CISA added it to the Known Exploited Vulnerabilities catalog on 9 November 2026.

Root cause: three behaviors that collide

None of these is a bug on its own. The flaw is in how they combine.

  1. A * in /etc/shadow means "no password matches". Key-only users, directory users and, on Alpine since about version 3.16, root carry a *.
  2. musl's password hashing returns the string "*" on failure instead of an error value. Systems using glibc with libxcrypt return *0 or *1 instead, which can never equal a one-character *.
  3. musl's SHA-256 and SHA-512 hashing rejects over-long keys (a KEY_MAX of 256 bytes, added years ago as denial-of-service protection) and reports that rejection as a failure.

So the failure in point 3 produces the "*" in point 2, which equals the locked marker in point 1. The matching code in OpenSSH compares the hashing result directly against the stored field:

cThe result of hashing is compared straight against the stored value
/* auth-passwd.c, sys_auth_passwd(), before 10.6p2 (excerpt) */
encrypted_password = xcrypt(password, salt);
...
return encrypted_password != NULL &&
    strcmp(encrypted_password, pw_password) == 0;

The salt that sshd passes in comes from pick_salt(), which borrows the first real hash it can find from another account. That borrowing was itself a fix, added in 2016 for CVE-2016-6210, so that failed logins for locked or missing accounts would not be faster than real ones and give away which users exist. A defensive timing fix from 2016 is what set up this bug nine years later.

Why this is a logic flaw, not memory corruption. Nothing overflows and nothing is corrupted. Every function behaves exactly as written. The defect is that two different meanings, "hashing failed" and "account locked", were allowed to share one representation, and the comparison never accounted for that. These are some of the hardest bugs to spot in review, because each line is individually correct.

Which systems are actually exposed

All of these have to be true at once. That is why the CVE record rates attack complexity as High, and why most servers are not affected.

ConditionWhy it matters
sshd linked against musl libcglibc with libxcrypt never returns a bare "*". Alpine, OpenWrt, Buildroot and Yocto images can be exposed
No PAM in the password pathAlpine's plain openssh-server has no PAM. A build with UsePAM yes is not affected
PasswordAuthentication yesThis is the default setting
A target account whose field is exactly *Accounts locked with ! instead are not exposed
Another account with a $5$ or $6$ hash presentWithout one, the borrowed salt stays a harmless default and nothing triggers
OpenSSH before 10.6p2 with no backported fixThe borrowing logic has shipped since the 2016 timing fix

Not affected: systems on glibc (Debian, Ubuntu, Fedora, Red Hat), any setup using PAM, Dropbear instead of OpenSSH, and OpenBSD. Ubuntu and Red Hat have both published "not affected". The impact where it does apply is a login as the affected account; on some Alpine cloud images that account can then escalate further, which is the reason to treat it as critical rather than moderate.

The fix

OpenSSH 10.6p2 (commit 4353fdc) closed the hole with a small, blunt change: a stored field shorter than four characters can never authenticate, no matter what the hashing function returns.

diffThe fix: a one-character "*" can never be a valid hash
/* auth-passwd.c, after 10.6p2 (excerpt) */
+#define MIN_PASSWORD_HASH_LEN 4
 ...
 ret = encrypted_password != NULL &&
+    strlen(pw_password) >= MIN_PASSWORD_HASH_LEN &&
     strcmp(encrypted_password, pw_password) == 0;

The same change also stops sshd from holding a pointer into the C library's internal buffer (it now keeps its own copy), which had made the behavior depend on how many times a connection had tried. The maintainers describe the fix as avoiding a problem they consider to live in the C library rather than in sshd. The musl project is separately planning to change its failure value so it can never equal a stored field, but no release includes that yet.

How it compares with regreSSHion (CVE-2024-6387)

SSHole is often mentioned alongside regreSSHion, the 2024 OpenSSH bug, because both are pre-authentication and both trace back to older code. They are otherwise very different.

regreSSHion (CVE-2024-6387)SSHole (CVE-2026-123158)
Bug classSignal-handler race conditionLogic flaw: a failure value treated as a valid hash
Platformglibc Linuxmusl Linux, no PAM
ReliabilityProbabilistic; the researchers reported winning the race only after many hoursDeterministic once the preconditions are met
ResultRemote code execution as rootLogin as the affected account; further escalation only on some images
Workaround costDisabling the grace timeout opens a denial-of-service riskDisabling password auth removes password logins entirely

The shared lesson is that both bugs came from defensive code that was correct when written and only became dangerous after later changes elsewhere. For background on the earlier bug, searches for "regreSSHion" and "CVE-2024-6387" still point to the Qualys advisory that first described it.

Detection

No vendor has published a Sigma or similar rule for this CVE as of mid-November 2026, but the log signal is clear.

  • Hunt for the impossible success. In /var/log/messages (syslog on Alpine), look for Accepted password for <user> lines naming accounts that should never accept a password at all: root, service accounts, key-only users and, on Alpine cloud images, the alpine user.
  • A failure right before the success. Because exploitation does not succeed on the very first try within a connection, a genuine abuse usually shows a Failed password entry from the same source address and port immediately before the Accepted password line for one of those accounts.
  • Network traffic alone will not tell you. GreyNoise notes you cannot distinguish a bypass login from a normal password login by looking at the wire; the signal is in the host logs.

Reported in-the-wild activity has been small in scale. Public threat intelligence describes a handful of confirmed intrusions, some installing a cryptocurrency miner, in the days after disclosure. Treat any password login to a key-only account as an incident until proven otherwise.

What to do

  1. Check your exposure. Confirm whether sshd is linked against musl, whether PAM is in use, whether password authentication is on, and whether any account's shadow field is exactly * while another account has a $5$/$6$ hash. Only the combination is dangerous.
  2. Patch to a fixed build. On Alpine the upstream version string is kept, so check the package revision with apk info -v openssh against Alpine's advisory rather than trusting the banner. Upgrading the package does not restart the service: run rc-service sshd restart.
  3. If you cannot patch immediately, set PasswordAuthentication no and restart sshd, after confirming key-based access works so you do not lock yourself out. This removes password logins entirely, which is the trade-off.
  4. Keep root as prohibit-password (Alpine's default), which protects root even on an affected build.
  5. Review logs for the signal above over the period since 5 November 2026.

If you run a fleet of Alpine or embedded Linux hosts and are not sure which are exposed, a security review can inventory them and check the real package revisions.

Sources

Topics:Exploit Write-upsCVE AlertsNetwork Security

Need a hand with this?

Talk to a senior consultant. We reply within one business day with clear next steps and a scoped quote.

Prefer to just ask? Contact us and a consultant will reply.

Written by

Vince Antonio

Security writer and consultant, NextGarrison

Vince writes NextGarrison's security news, technical vulnerability write-ups and guides. He covers actively exploited flaws, penetration testing, SOC monitoring and getting ready for SOC 2, ISO 27001 and PCI DSS, in plain English with sources for every claim.

Want the next alert like this one?

New vulnerability alerts as soon as we publish them. Free, no sign-up, works in Feedly, Outlook, Slack and Teams.

Frequently Asked Questions

What is the root cause of SSHole?

A failed password hash and a locked account are both represented by a single "*" on musl systems, so a comparison that should fail instead matches. It is a logic flaw, not memory corruption.

Is my server affected?

Only if sshd is built against musl (Alpine, OpenWrt and similar), does not use PAM, allows password logins, and has an account with a "*" field alongside another account with a modern hash. glibc systems such as Debian, Ubuntu and Red Hat are not affected.

How do I check if I am patched on Alpine?

Do not trust the SSH banner. Alpine backported the fix without changing the upstream version, so run apk info -v openssh and compare the package revision against Alpine's advisory, then restart sshd.

How is this different from regreSSHion?

regreSSHion (CVE-2024-6387) was a race condition on glibc that could lead to code execution as root but only after many attempts. SSHole is a deterministic logic flaw on musl that grants a login to the affected account.

Keep reading