
Read-only exposure and compromise check for CVE-2026-123158, the musl-only OpenSSH password-auth bypass
A read-only check for CVE-2026-123158, the OpenSSH bug nicknamed "*sshole".
On musl libc, a password longer than 256 bytes makes crypt() fail and hand
back the literal string "*". OpenSSH compares that against the account's
stored password field. When the field is exactly "*", which means "no
password", the strings match and sshd lets you in.
Two prompts on one connection: any wrong password, then a long one. No brute force, no memory corruption.
Upstream fixed it in OpenSSH 10.6p2 on 5 November 2026.
Six conditions, all required:
| # | Condition |
|---|---|
| 1 | OpenSSH < 10.6p2, or an unpatched distro backport |
| 2 | musl libc: Alpine, OpenWrt with OpenSSH installed, Buildroot, Void-musl |
| 3 | sshd built without PAM, or UsePAM no |
| 4 | PasswordAuthentication yes |
| 5 | an SSH-eligible account whose shadow field is exactly * |
| 6 | another account holding a real $5$ or $6$ hash (the donor salt) |
Plenty of things people worry about turn out to be fine. glibc distros are
structurally immune: Debian, Ubuntu, RHEL, Fedora, Arch. So is Dropbear, which
covers a stock OpenWrt router and most IP-KVMs. So is any sshd running under
PAM, and any account locked with ! instead of * — ! never equals *.
The one that catches people out: a patched package that was never restarted is still exploitable. The running process keeps the old binary mapped.
./check-sshole.sh # this host
./check-sshole.sh --ssh [email protected]
./check-sshole.sh --ssh myserver # a Host alias from ~/.ssh/config
./check-sshole.sh --estate-dir ~/infra # every */ssh.env under ~/infra
./check-sshole.sh --estate-dir ~/infra --quiet # one line per host
--estate-dir walks one level down for */ssh.env files, reads HOST, USER
and KEY_PATH from each, drops duplicate hosts, and pipes the script over SSH.
It never touches the PASSWORD field. --estate is the same thing but looks
next to the script's own parent directory, which only makes sense if you keep
the script inside your infrastructure repo.
--ssh work with your keysThe simplest form is to pass a Host alias from your ~/.ssh/config. ssh then
applies the user, port and IdentityFile you already configured:
./check-sshole.sh --ssh myserver --ssh otherbox
A bare user@ip does not match a Host block keyed on an alias, so ssh
falls back to default identities and you get Permission denied (publickey).
Give it the key explicitly in that case:
./check-sshole.sh --ssh [email protected] --key ~/.ssh/id_ed25519
For a host you have never connected to, BatchMode turns the "are you sure"
prompt into a hard Host key verification failed. Either connect once by hand,
or let the script trust it on first use:
./check-sshole.sh --ssh myserver --accept-new
Do not run the fan-out under sudo. ssh would read /root/.ssh, which has no
config and no known_hosts, and every host fails with Host key verification failed. The script escalates by itself with sudo -n — or doas -n where
there is no sudo, as on Alpine — when it needs to read /etc/shadow.
Other flags: --containers, --no-logs, --no-sudo, --no-color.
| Code | Meaning |
|---|---|
| 0 | clean — not affected, or patched and restarted |
| 1 | action needed — vulnerable, exposed, or a stale daemon or config |
| 2 | unknown — a precondition could not be determined |
| 3 | compromise indicators in the logs |
| 64 | usage error |
In --estate mode you get the worst host back, and exit 1 outranks exit 2. One
unreachable box shouldn't hide a vulnerable one.
Most results are a shrug. NOT AFFECTED (glibc), NOT AFFECTED (no sshd),
NOT AFFECTED (PAM authentication), MITIGATED (PasswordAuthentication no)
and plain PATCHED all mean there's nothing to do.
VULNERABLE — all preconditions met means patch now, or turn password auth
off. The softer VULNERABLE — patch missing; preconditions not currently met
means patch at the next window; you're one new user account away from the first
case.
PATCHED BUT NOT RESTARTED is the one people skim past. You are still
exploitable.
MITIGATED — UNVERIFIED means the config file says no, but the daemon was
never asked, or hasn't reloaded since. Go check by hand.
COMPROMISE INDICATORS means someone got in. See below.
The only trace this bug leaves is an impossible success: Accepted password for an account that has no password. Logs never record password length, so
there is nothing else to grep for.
Don't just patch. Rotate every credential that touched the host — SSH keys, API
tokens, service passwords, the vault. Then read authorized_keys for every
account, look for new users, new cron entries and new systemd units, and check
doas/sudo history. Alpine's advisory is blunt about it: if you can't rule
out a login, treat the machine as compromised.
Log rotation is the big one. It reads the current log and one rotated copy,
plus journalctl and logread. If your logs roll faster than an attacker
visits, the hunt comes back empty and that isn't proof of anything.
Containers are opt-in, because --containers runs a shell inside every running
container.
Directory accounts on musl are invisible. musl has no NSS module support, so LDAP and SSSD users don't exist as far as a musl sshd is concerned. That's a blind spot in the scan, not a finding.
And the payload itself is unlogged. There is no "oversized password" line anywhere, on any system.
Alpine backports the fix without touching the banner. A patched 3.24 still
reports OpenSSH_10.3p1 and looks vulnerable. So the script compares the apk
package version against a per-branch table and treats the banner as advisory.
| Branch | Fixed 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 |
# Alpine
apk upgrade -U -a
rc-service sshd restart
# anything else
PasswordAuthentication no # in sshd_config, then restart sshd
# verify
sshd -T | grep -i ^passwordauthentication
MIT. See LICENSE.