
Scans SSH hosts for the musl libc crypt() authentication bypass (CVE-2026-123158) with single-host checks, CIDR sweeps, and a Docker test lab.
Disclosed 2026-11-05. CVSS 3.1: 8.1 (High).
On Linux systems where sshd is built against musl libc without PAM
(the default on Alpine Linux, and common on minimal/embedded images), an
attacker can authenticate to certain accounts with no valid password at
all by sending an oversized password.
Who is affected: Alpine-based systems and containers, and anything else running musl + non-PAM OpenSSH. Debian, Ubuntu, RHEL, and anything using glibc + PAM (the vast majority of servers) are not affected.
Mechanism, in order:
/etc/shadow is * (meaning
"no password — this account should never authenticate with one").
* is only 1 byte, too short for OpenSSH to use as its own salt, so
sys_auth_passwd() falls back to pick_salt() — a function from a
2016 OpenSSH fix (CVE-2016-6210) meant to stop username enumeration.
pick_salt() borrows the salt from the first real password hash it
finds anywhere else on the system (e.g. another user's $6$...$
hash).crypt() has a bug: given a password over 256 bytes, it
returns the literal string "*" instead of a real hash or an error —
regardless of which salt was used."*" against the target account's stored field,
which is also "*". They match. Login succeeds.getspnam() buffer-reuse artifact); the second
attempt on the same connection succeeds. Both this lab's test
scripts rely on exactly this: one connection, the oversized password
sent twice.Fixed upstream in OpenSSH 10.6p2 (2026-11-05). Alpine has shipped patched
packages for all currently supported branches. If you're running Alpine
or another musl-based image with password auth enabled, update now:
apk upgrade -U -a && rc-service sshd restart (restart is required —
updating the package alone does not replace the running process).
| File | Purpose |
|---|---|
Dockerfile | Builds the deliberately-vulnerable test container. Compiles OpenSSH from source at the pre-fix tag V_9_7_P1 with --without-pam — not apk add openssh-server, because Alpine's own package already carries the fix as of 2026-11-05, so that approach silently produces a non-vulnerable container. |
compose.yaml | Runs the container bound to 127.0.0.1:2222 only (itself — never the LAN or WAN), on its own private Docker network, isolated from every other container on the host. |
check_musl_crypt_bypass.py | Single-host, single-account detailed test. Use this against the lab container, or any one host/account you want to check closely. |
scan_musl_crypt_bypass.py | Subnet scanner. Sweeps a CIDR range, tests a list of usernames against every host with SSH open, and writes a report. Use this one for infrastructure sweeps. |
Two accounts:
baseline — a real password, proves the container works and isn't
vulnerable to "any long password gets in."victim — password field is * in /etc/shadow. This is the
vulnerable account.Start/rebuild it:
cd ~/sshhole-lab
docker compose up -d --build
It's reachable only from the host itself, at 127.0.0.1:2222.
Both need paramiko. A venv is recommended python3 -m venv sshole-lab.
Activate the venv source sshole-lab/bin/activate
Install paramiko into the virtual environment pip install paramiko
python3 check_musl_crypt_bypass.py <host> <port> <username>
Example, against the lab container from the host itself:
python3 check_musl_crypt_bypass.py 127.0.0.1 2222 victim
Exit code 10 = vulnerable, 0 = not, 2 = inconclusive (connection error, or the account doesn't behave as expected for this test).
python3 scan_musl_crypt_bypass.py <cidr> [options]
Examples:
# Default: just tries "root" against everything with SSH open on the subnet
python3 scan_musl_crypt_bypass.py 10.27.99.0/24
# Try a specific set of usernames you know exist on your devices
python3 scan_musl_crypt_bypass.py 10.27.99.0/24 --users root,admin,pi,ubuntu,deploy
# Non-standard SSH port, lower concurrency, write a CSV too
python3 scan_musl_crypt_bypass.py 10.27.99.0/24 --port 2222 --workers 10 --csv report.csv
Options:
| Flag | Default | Meaning |
|---|---|---|
cidr | — | required; a subnet (10.27.99.0/24) or single IP |
--port | 22 | SSH port to test |
--users | root | comma-separated usernames to try per host |
--workers | 20 | concurrent hosts probed at once |
--timeout | 4.0 | per-connection timeout, seconds |
--report | musl_crypt_report.json | JSON report path |
--csv | (none) | optional CSV report path |
Exit code 10 if anything came back vulnerable, 0 otherwise — safe to use in a script/cron check.
Important — you must know the usernames. This bug only shows up
against an account that actually exists on the target and is already
password-locked (* in shadow) or has a hash pick_salt() can borrow
around. A username the scanner doesn't try is a username it says
nothing about. Default root alone is a weak sweep — add any service
or device-default account names you know are in use (pi, ubuntu,
admin, deploy, etc).
Reading results per host/username:
| Status | Meaning |
|---|---|
VULNERABLE | Oversized password authenticated on attempt 2 — matches this CVE exactly. Patch this host. |
NOT VULNERABLE | This specific attack didn't work for this username on this host. Does not confirm the username exists — OpenSSH deliberately makes "no such account" and "account exists and is safe" look identical over the wire (same 2016 anti-enumeration design that causes this bug elsewhere). |
WEAK PASSWORD (different issue) | The oversized password was accepted on attempt 1. Real exploitation of this CVE only ever succeeds on attempt 2 — an attempt-1 accept means this account has no real password check at all. Different, separate problem. Fix it too. |
ERROR | Connection dropped/timed out mid-test. Inconclusive — not evidence either way. |
--users and --workers modest
on networks you're actively monitoring with such tools, and expect to
see your own scans in those logs.apk upgrade -U -a (fixed packages
have been available since the 2026-11-05 disclosure).sshd — updating the package alone doesn't replace the
already-running process: rc-service sshd restart (or restart the
container/service, however that host runs it).PasswordAuthentication no in
sshd_config as a stop-gap (key-only auth isn't affected) and
restart sshd.