Alpine's OpenSSH bypass: who it hits and how to close it
A password bypass in OpenSSH on musl systems without PAM lets attackers into key-only Alpine accounts. The check, the fixed builds, and why a restart is required.
Short version: on 5 November 2026 OpenSSH shipped 10.6p2 for a bug that lets an attacker log in to some Alpine servers without knowing any password. One connection, no retries. It is fixed in Alpine 3.21.10, 3.22.8, 3.23.8 and 3.24.4, and upgrading is not enough on its own: you have to restart sshd.
An empty password is accepted as correct
sshd decides whether a password is correct by comparing it against the account's stored hash. On the shadow field *, the marker for an account with no password (which is how key-only accounts and Alpine's shipped root are stored), the comparison is supposed to fail every time.
On systems using musl libc with PAM disabled, it does not. The C library's crypt() misreads a string that is not a password hash as though it were one, and sshd takes the result as a match. Send a password between 256 and 1024 characters and the account opens (CVE-2026-123158, CVSS 8.1, published the same day).
The OpenSSH release notes put the root cause outside sshd — "we consider the root cause of this bug to be outside sshd, but it is exploitable via sshd and can be avoided there" (10.6p2 release notes). The fix is commit 4353fdc in the portable tree.
musl without PAM, plus a starred shadow entry
All of these have to be true:
sshdbuilt without PAM. On Alpine that is the plainopenssh-serverpackage;openssh-server-pamwithUsePAM yesis not affected.PasswordAuthentication yes: the OpenSSH default, so unless you changed it, it is on.- At least one account whose shadow field is exactly
*. Key-only users created without a password are the common case, and Alpine shipsroot:*in the base image. - At least one other account with a
$5$or$6$(SHA-256/SHA-512) hash. That account is not the target; it is what makes the target reachable, because the mismatch is only produced when a real salt-and-hash comparison is attempted.
That last requirement is the part people get wrong. The intuition is "my key-only users have no password, so a password attack cannot succeed against them." The advisory says the opposite: one password-protected account on the box makes every passwordless account loggable.
Affected: Alpine 3.16 through 3.24 and edge, including releases that no longer get regular updates (Alpine advisory). Not affected: containers that do not run sshd, systems with PasswordAuthentication no, openssh-server-pam with UsePAM yes, and locked accounts (! in the shadow field, which cannot log in at all).
sshd -T, then upgrade and restart
Find out what you are running:
# is this Alpine, and which build of sshd?
cat /etc/alpine-release 2>/dev/null
ssh -V
Ask sshd what it is configured to do, rather than what the config file says:
sudo sshd -T | grep -iE '^(passwordauthentication|usepam|permitrootlogin)'
Then fix it. Upgrade and restart, because the running daemon keeps the old code until it is restarted:
apk upgrade openssh
rc-service sshd restart # or: /etc/init.d/sshd restart
Alpine's fixed builds are 3.21.10, 3.22.8, 3.23.8 and 3.24.4.
If you cannot patch today, PasswordAuthentication no in the sshd configuration closes it, at the cost of breaking anyone still logging in with a password. On a key-only fleet that is the correct setting anyway. If you are rebuilding the host rather than patching it, the first 24 hours on a new VPS covers the rest of the baseline.
Appliance images with SSH bolted on
Alpine is the base image of a great many containers, appliances and CI runners. Most of those never run sshd — they are fine. The dangerous shape is the one where somebody added SSH access to an Alpine-based appliance or VM image for convenience, left password authentication at its default, and then created a key-only user. That combination turns a maintenance convenience into an unauthenticated root path, and the appliance is usually internet-facing because remote administration was the point.
If you ship such an image, the fix belongs in the image, not in a customer advisory: build with openssh-server-pam and PAM enabled, or bake in PasswordAuthentication no. Shipping an Alpine appliance with sshd and default password authentication means every customer who takes the default is exposed on day one.