Alpine Linux: OpenSSH password authentication bypass — update openssh and restart sshd
Update · : The new article says that openssh-server-pam with UsePAM no is also affected, that root ships as root:* since about Alpine 3.16, and that doas-based escalation from the alpine account is a path to root. It also advises reviewing doas use, recently created users, files and authorized keys on exposed machines.
A flaw in the openssh-server package for Alpine Linux lets an attacker who can reach the SSH port log in without knowing any password: a single connection is enough, it works every time and needs no retries.
The attack needs the name of an account whose password field is * — an account with no password set, which is normal for key-only accounts — and a machine that has at least one other account with a $5$ or $6$ password hash. The attacker then sends a very long password of 257 to 1024 bytes; one user with a password is enough to make every account without one reachable. No CVE identifier had been assigned at the time of writing, and the details are in the OpenSSH 10.6p2 release notes.
All Alpine releases are affected — 3.21 through 3.24 and edge, plus 3.16 to 3.20, which no longer receive regular updates — where the openssh-server package built without PAM[1] is used with PasswordAuthentication yes, the OpenSSH default. Fixed packages ship in Alpine 3.21.10, 3.22.8, 3.23.8 and 3.24.4; 3.21 reached its end of support on 2026-11-01, but fixes have been published for every release back to 3.16. Upgrading the package alone does not replace the running daemon, so sshd must be restarted after the update, and admins who cannot update yet should set PasswordAuthentication no and restart sshd instead.
The official tiny-cloud images from 3.18.11 through 3.24.3 ship an alpine user with a * password field and passwordless doas[2]; they are safe on first boot but become exploitable as soon as any $6$ hash exists, after which an attacker gets a shell as alpine and can use doas to become root. The cause is that sshd built without PAM checks passwords by hashing the attempt with crypt()[3], and crypt() in musl[4] returns the string * as an error indicator when the key is over 256 bytes long — exactly the stored password field of accounts with no password, so the “hash” matches and the login succeeds. To detect an attack, check /var/log/messages for sshd lines reading Accepted password for an account that has no password, and treat the machine as compromised if such a login cannot be ruled out.
Read the original alpinelinux.orgDiscussion
Sources
-
alpinelinux.org
Security advisory: openssh-server password authentication bypass
-
alpinelinux.org
Alpine Linux : openssh-server password authentication bypass


