
Read-only scanner that detects the OpenSSH musl/PAM password-authentication bypass (CVE-2026-123158) on local, offline, or remote hosts, with JSON output and log IoC checks.
Detects the OpenSSH password-authentication bypass ("sshhole"). It affects sshd on
Linux when sshd is built against musl libc and runs without PAM (for example,
Alpine's default openssh-server).
How the bug works: for an account whose shadow password field is *, sshd borrows
the salt from another account's $5$/$6$ hash. musl's crypt() fails on any key
longer than 256 bytes and returns "*" when it fails. That return value matches the
stored *, so any password of 257–1024 bytes logs in.
This CVE is in CISA's Known Exploited Vulnerabilities (KEV) catalog. The tool never attempts the bypass. It only reads files, config, and logs (or, in remote mode, the SSH banner and the list of auth methods the server offers).
sudo python3 sshhole_scan.py
Audits the local host. Run it as root so it can read /etc/shadow and run sshd -T.
python3 sshhole_scan.py --root /mnt/image
Audits an offline filesystem, such as a mounted disk or a container image extracted
with docker export <ctr> | tar -x -C /mnt/image.
python3 sshhole_scan.py --remote 10.0.0.5 --user alpine
Runs a remote triage check. Install paramiko if you want the auth-method probe.
Add --json to get machine-readable output. Exit codes: 0 not vulnerable,
1 vulnerable, 2 potentially vulnerable or undetermined, 3 error.
| Check | Vulnerable when |
|---|---|
| libc | sshd uses ld-musl-* |
| PAM | sshd isn't linked to libpam, or UsePAM isn't yes |
| Version | Alpine: package below the fixed release for its branch (3.16–3.24, edge; EOL branches have no fix). Elsewhere: below 10.6p2 |
| PasswordAuthentication | not no (reads sshd -T, or sshd_config plus Include files) |
| Accounts | an SSH-reachable account has shadow field exactly *. Accounts out of reach because of PermitRootLogin, AllowUsers or DenyUsers are marked "blocked" |
| Salt source | at least one $5$/$6$ hash exists |
| Directory users | nsswitch uses ldap, sss or winbind (warning only) |
| Indicators of compromise (IoC) in logs | Accepted password for <*-account> in /var/log/messages*, auth.log* or secure* |
*. It can only clear a
host or mark it as "potentially vulnerable." Alpine backports also keep the old version
string in the SSH banner.Match blocks in sshd_config are ignored when the tool parses the file directly.
Running as root uses sshd -T, which gives the effective config.journalctl -u sshd | grep 'Accepted password'.Run apk upgrade -U -a && rc-service sshd restart. Upgrading doesn't restart the
running daemon. Until you can upgrade, set PasswordAuthentication no.
Tests: python3 test_sshhole_scan.py (10 offline scenarios).