Skip to main content
November 30, 2026

sshhole: OpenSSH Password Bypass on Alpine and musl

sshhole: OpenSSH Password Bypass on Alpine and musl

On November 5, 2026, the OpenSSH team shipped OpenSSH 10.6p2 with what the release notes call "a critical security workaround that affects Linux systems that use the musl libc and PAM disabled." The bug, nicknamed sshhole after the domain of its write-up (the write-up itself, the oss-security announcement and the PoC repo spell it "sshole"), lets an attacker log in as an account that should never accept a password. The attacker needs no key and no knowledge of the real password. The bug was reported by Özgün Kültekin of Wakefield.

"Alpine, small attack surface, fine" is the wrong reflex here. A minimal image is not a safe image, and the accounts this bug opens are the ones you set up to be key-only.

How the Bypass Works

Three pieces of ordinary code line up badly.

1. musl's crypt() returns "*" on error. In musl's SHA-512 crypt, the header comment says "on error "*" is returned." One of those errors is a key that is too long: #define KEY_MAX 256, with the comment "key limit is not part of the original design, added for DoS protection." A password of 257 bytes or more makes the hash function fail, and the wrapper returns the string * instead of NULL. sshd only rejects a NULL result.

2. sshd borrows a salt from another account. When the stored password field is shorter than two characters, sshd does not use it as a salt. xcrypt.c then calls pick_salt(), which walks the account database and takes the salt from the first entry whose hash starts with $. That path exists so a failed login costs the same time as a real one. On a box where root is * and some user has a $6$... hash, the candidate password is hashed with that user's SHA-512 salt.

3. The comparison is a plain strcmp. sshd's built-in password check (used when PAM is off) accepts the login when the hashed candidate equals the stored field. The stored field of a key-only account is *. musl's error output is *. They match.

So the attack is: pick an account whose shadow field is exactly *, send a password between 257 and 1,024 bytes (OpenSSH caps passwords at 1,024), and sshd lets you in. The write-up notes that a fresh box with no passwords set is not affected, and the README lists the reason as a condition: at least one account must have a real $5$ or $6$ hash to donate a salt.

The fix commit, "avoid password authn bypass," adds MIN_PASSWORD_HASH_LEN 4 to auth-passwd.c: a stored field shorter than four bytes can no longer match anything. It also copies the shadow string instead of keeping a pointer into libc's static buffer. Both the release notes and the commit say the OpenSSH team considers the root cause to be outside sshd. It is still exploitable through sshd, so sshd is where it was closed.

Why Alpine Gets Hit Hardest

The write-up traces the history. Alpine's stock openssh-server package is built without PAM. Password authentication is on by default in OpenSSH. And since Alpine 3.16, root's shadow entry is * rather than !, a 2022 change that kept password login blocked while letting key logins work with PAM disabled. The write-up also lists key-only deploy users, LDAP users, and the default alpine user on Alpine's AWS and Azure images as typical * accounts. It notes that the latter has passwordless doas, so a login there is root.

The PoC builds a stock Alpine 3.24 image with openssh-server and reproduces the login. The README says it works "at least back to 3.18," and its oldest test was OpenSSH 7.5p1 on musl 1.1.16 from 2017. The same pieces can line up outside Alpine on any musl-based OpenSSH build: the write-up names OpenWrt, Buildroot, and Yocto as musl systems to check.

Am I Exposed? A Decision Table

The README says you are exposed only when every condition holds. Walk the table top to bottom and stop at the first "No":

Question If "No" How to check
Is sshd linked against musl? Not affected (glibc, OpenBSD, FreeBSD, macOS) ls /lib/ld-musl-*.so.1
Is sshd older than 10.6p2 or an unpatched distro build? Not affected sshd -V, then your distro's changelog
Does sshd run without PAM? Not affected (openssh-server-pam with UsePAM yes is safe) sshd -T | grep -i usepam
Is PasswordAuthentication on? Not affected sshd -T | grep -i passwordauthentication
Does some account have exactly * as its password field? Not affected awk -F: '$2=="*"' /etc/shadow
Does some other account have a $5$ or $6$ hash? Not affected awk -F: '$2 ~ /^\$[56]\$/' /etc/shadow

If every answer is "Yes," treat the host as open to anyone who can reach port 22. Accounts from LDAP or SSSD count too: the check script greps /etc/nsswitch.conf for ldap, winbind, and sss, because those users may also come back with *.

Run the Check Script

The researchers publish check.sh. It needs root, reads only local files and sshd output, and returns 0 for exposed, 1 for not exposed, and 2 for "cannot tell." Read it before you run it, as with any script you download:

curl -sO https://raw.githubusercontent.com/oz9un/sshole/main/check.sh
less check.sh
sudo sh check.sh; echo "exit=$?"

Containers are where this hides, so run the same script inside every image that ships sshd: bastion images, SFTP drop boxes, CI runners, dev containers, and appliance images. Mount the script read-only and run it as root inside each image:

for img in $(docker images --format '{{.Repository}}:{{.Tag}}' | grep -v '<none>'); do
  docker run --rm --user 0 --entrypoint /bin/sh \
    -v "$PWD/check.sh:/check.sh:ro" "$img" -c \
    'command -v sshd >/dev/null || exit 3; sh /check.sh >/dev/null 2>&1' 2>/dev/null
  case $? in
    0) echo "EXPOSED  $img" ;;
    2) echo "UNKNOWN  $img" ;;
  esac
done

Exit code 3 means the image has no sshd, and 1 means the script found a missing condition. Both stay silent. Anything marked UNKNOWN needs a manual look.

Failure Mode: The Version String Lies

The script decides "fixed" by matching the sshd -V string against 10.6p2 and later. Alpine's stable branches do not all carry 10.6p2. On pkgs.alpinelinux.org, only edge shows 10.6_p2-r0. The stable branches show new package releases with build dates of 2026-11-05:

Alpine branch openssh-server package
edge 10.6_p2-r0
v3.24 10.3_p1-r2
v3.23 10.2_p1-r1
v3.22 10.0_p1-r11
v3.21 9.9_p2-r1

The package index does not say what those rebuilds contain. If your branch carries a backport under an older upstream version, the script's version check cannot see it, and the script's own comments warn that distros may backport without changing the version. Confirm the fix from the package changelog or the APKBUILD, not from sshd -V. The reverse also holds: an image built before November 5 keeps the old package until someone rebuilds it, no matter what the repository now offers.

What to Do Now

  1. Turn off password logins on anything that does not need them. The oss-security post confirms this mitigates the bug:
    echo "PasswordAuthentication no" > /etc/ssh/sshd_config.d/00-no-passwords.conf
    rc-service sshd restart
    
    Put it in the image, not in a runbook. Check the effective value with sshd -T, since the first value sshd reads for a keyword wins.
  2. Upgrade and rebuild. Run apk upgrade openssh on hosts, then rebuild and redeploy images. Pinned base tags and stale CI caches keep old packages alive.
  3. Search your logs. Look for Accepted password for lines for accounts that are supposed to be key-only, root first.
  4. Prefer keys or certificates for humans. If you still need password logins for a reason, use the PAM build with UsePAM yes. Short-lived SSH certificates remove the reason most teams had for keeping passwords on.
  5. Add the check to image CI. Fail the build when check.sh exits 0, the same way you fail on a critical scanner finding.

Treat this like any other access-layer change, as we argued in our OpenSSH 10.4 upgrade notes: test bastions and automation paths first, because those are the hosts you need when something else breaks.

Conclusion

sshhole is not a crypto break. It is three reasonable defaults meeting: a libc that signals errors with *, a timing defense that borrows a real salt, and an account field that uses * to mean "no password." Together they open the accounts you trusted most. Check the six conditions, rebuild your images, and switch password logins off where you can.

Akmatori's SSH connector works with key-based authentication and keeps hosts read-only by default, so the agent runs only diagnostic commands unless you allow write commands.

If your team wants AI-assisted incident workflows on your own infrastructure, Akmatori helps SRE teams investigate alerts, coordinate response, and automate safe infrastructure actions. Powered by Gcore for global infrastructure reliability.

Automate incident response and prevent on-call burnout with AI-driven agents!