
Detection-only shell checker for the OpenSSH musl password-auth bypass (CVE-2026-123158): audits local hosts, remote hosts over SSH, or probes address ranges without credentials.
MaSSHole (MaSSHole.sh) is a detection-only checker for *sshole (CVE-2026-123158), the OpenSSH
password-authentication bypass on musl-based Linux systems such as Alpine.
It can audit the machine it runs on, audit other machines over SSH, or probe a whole address range without logging in. It never sends a password and never attempts the bypass.
To try it against known-good and known-bad hosts first, see the Docker test lab.
On musl libc, OpenSSH's own password check (used when sshd runs without PAM)
mishandles accounts whose /etc/shadow field is *, meaning "no password".
A password between 257 and 1024 bytes is accepted for those accounts. It was
fixed in OpenSSH 10.6p2, and Alpine backported the fix to its stable branches.
A host is exposed when all of these are true:
| Condition | Typical on Alpine? |
|---|---|
| sshd is linked against musl libc | Yes |
sshd runs without PAM (openssh-server package, or UsePAM no) | Yes, default package |
PasswordAuthentication yes for the account | Yes, OpenSSH default |
An account has * as its shadow password field and can log in | root:* by default, alpine:* on cloud images |
At least one account has a SHA-256/512 ($5$/$6$) hash | Common |
| OpenSSH is older than the fixed version for that distro branch | Until you upgrade |
Root is usually protected by the default PermitRootLogin prohibit-password.
glibc distributions, PAM-enabled sshd, Dropbear and non-Linux systems are not
affected.
| Alpine branch | Fixed openssh 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.16–3.19 | Patched too; check the Alpine advisory for exact versions |
| Upstream / other musl builds | OpenSSH 10.6p2 |
sh. It works with BusyBox ash (Alpine), dash and bash, and
needs only standard tools (awk, sed, grep)./etc/shadow and runs sshd -T.ssh client. timeout and ip
are used when present.sudo/doas rule on them.chmod +x MaSSHole.sh
./MaSSHole.sh --help
Nothing needs installing on the targets for remote mode, because the script is piped over SSH and run there.
--local: audit this machinesudo ./MaSSHole.sh --local
It checks, in order:
sshd -T: PAM, PasswordAuthentication,
PermitRootLogin, Allow/Deny rules.* (or other short) shadow field. Each one is
re-evaluated with sshd -T -C user=…, so Match blocks count.Accepted password for <password-less account>
in /var/log/messages*, auth.log*, secure*, logread and journalctl.
Skip this with --no-logs.--remote: audit other machines over SSHRuns the local audit on each destination and collects the verdicts.
./MaSSHole.sh --remote -d 10.0.0.0/28 -l root
./MaSSHole.sh --remote -d 10.0.0.0/28 -l alpine --elevate doas -i ~/.ssh/fleet_key
When there is more than one host, full per-host reports are saved to
masshole-reports-<timestamp>/, or to the folder given with --outdir.
--network: unauthenticated probeConnects, reads the SSH banner, and asks the server which authentication methods
it offers to each probe user (using the SSH none method). No credentials are
sent.
./MaSSHole.sh --network -d 10.0.0.0/24 --csv scan.csv
From the outside, a fixed Alpine host looks identical to a vulnerable one,
because Alpine backports keep the old version string. Network mode therefore
reports candidates. Confirm them with --remote or --local.
Expect the two modes to disagree on the same hosts. That's by design, not a fault: they can see very different amounts.
| Condition | --network can see it? | --remote / --local can see it? |
|---|---|---|
| OpenSSH version | Partly: banner only, often without the p1/p2 suffix | Yes |
| Distro (Debian/Ubuntu suffix) | Sometimes: only distros that add a banner suffix | Yes |
| musl or glibc | No | Yes |
| PAM in use | No | Yes, from sshd -T |
| Patched Alpine package (backport) | No: the version string doesn't change | Yes, from the apk database |
| Password auth offered | Yes, for the probe users | Yes, per account including Match rules |
* accounts and SHA-256/512 hashes | No | Yes, from /etc/shadow |
| Signs of past compromise | No | Yes, from the logs |
So network mode can rule hosts out reliably (glibc distros, Dropbear, password auth off, OpenSSH 10.7 and later), but it can only flag the rest as candidates. Fixed Alpine hosts, PAM builds and already-compromised hosts all look the same as a vulnerable host from outside. Remote mode separates them.
Typical results for the same host:
| Host | --network | --remote |
|---|---|---|
| Unpatched Alpine, password auth on | CANDIDATE | VULNERABLE |
| Patched Alpine package | CANDIDATE | OK (patched) |
| Alpine with PAM | CANDIDATE | OK (PAM in use) |
Unpatched, PasswordAuthentication no | NO_PASSWORD_AUTH | AT_RISK (upgrade anyway) |
| Debian / Ubuntu | NOT_AFFECTED | OK (glibc) |
| Unpatched and already exploited | CANDIDATE | COMPROMISED |
Suggested workflow: sweep the range with --network (no credentials
needed), then run --remote against the CANDIDATE hosts to confirm. The
lab shows
this with real output.
| Option | Meaning |
|---|---|
-s, --source ADDR|IFACE | Local address (ssh -b) or interface (ssh -B, OpenSSH 8.9+) to send from. It is checked to exist before scanning. |
-d, --dest TARGETS | Destinations; can be repeated. Comma- or space-separated. |
-f, --dest-file FILE | Destinations from a file, one or more per line, with # comments. |
-p, --port N | Default port. Network mode uses 22; remote mode uses your ssh config. |
Destination formats can be mixed freely:
host host:2222 alpine@host [email protected]:2222
10.0.0.5 [2001:db8::1]:22 2001:db8::1
10.0.0.0/24 (CIDR; network and broadcast addresses skipped below /31)
10.0.0.10-50 (last-octet range)
10.0.0.10-10.0.1.20 (full range)