Alpine Linux Users Urged to Patch OpenSSH Authentication Flaw
The sshole vulnerability is a password-checking flaw in some OpenSSH servers. It matters because an attacker does not need an account password to access an affected account: a specially long password can be accepted even when the account is marked as having no usable password. For example, an attacker can target a passwordless account with a password between 257 and 1,024 characters. On affected systems, musl returns an asterisk when its crypt() function hits the password-length limit. Linux also uses an asterisk in /etc/shadow to mark an account as passwordless. OpenSSH can mistake that returned character for a successful match. The vulnerable combination is narrow: OpenSSH before 10.6p2, musl rather than glibc, and no PAM. The flaw is nevertheless being exploited in the wild. OpenSSH 10.6p2 fixes it; operators who cannot update can disable password authentication and check logs for suspicious successful logins.
What is the *sshole vulnerability, and what can an attacker do with it?
The *sshole vulnerability is a password-checking flaw in some OpenSSH servers. It matters because an attacker does not need an account password to access an affected account: a specially long password can be accepted even when the account is marked as having no usable password.
For example, an attacker can target a passwordless account with a password between 257 and 1,024 characters. On affected systems, musl returns an asterisk when its crypt() function hits the password-length limit. Linux also uses an asterisk in /etc/shadow to mark an account as passwordless. OpenSSH can mistake that returned character for a successful match.
The vulnerable combination is narrow: OpenSSH before 10.6p2, musl rather than glibc, and no PAM. The flaw is nevertheless being exploited in the wild. OpenSSH 10.6p2 fixes it; operators who cannot update can disable password authentication and check logs for suspicious successful logins.
Which systems are at risk, and what combination of OpenSSH, musl, and PAM settings makes them vulnerable?
The risk is not shared by every Linux server. The article identifies Alpine Linux as the most prominent affected distribution, and says other musl-based environments such as OpenWrt, Buildroot, and Yocto may also be at risk when the same configuration applies. The issue matters especially for teams using Alpine-based containers, embedded devices, or custom musl builds.
The required combination is OpenSSH earlier than 10.6p2, built against musl rather than glibc, and running without PAM. The server also needs at least one account with a SHA-256 or SHA-512 password hash and another account whose shadow entry contains an asterisk. When these conditions hold, a long password can be accepted for the passwordless account.
Systems using glibc, PAM, Dropbear, or OpenBSD are not affected, according to the article. Red Hat says its products do not meet the required combination, and Amazon marks Amazon Linux 2 and 2023 as unaffected. Operators should check the server's library and PAM configuration rather than assuming every Linux system is exposed.
How long does an attacker's password need to be, and why does that length matter?
An attacker needs a password longer than 256 characters: the article gives the exploitable range as 257 to 1,024 characters. That unusual length is central to the flaw, not just a way to make an ordinary password stronger. The vulnerability depends on what the system does when the password exceeds musl's hashing limit.
On an affected setup, musl's crypt() call returns an asterisk when it encounters a password longer than 256 bytes. Linux uses an asterisk in /etc/shadow to mark an account as having no usable password. OpenSSH can then treat the returned asterisk as if the supplied password matched, allowing login to the passwordless account.
The behavior only creates a security risk when the other conditions also apply: OpenSSH is older than 10.6p2, the server uses musl, PAM is not enabled, and the required account entries exist. The fix is in OpenSSH 10.6p2. Until an update is possible, operators can disable password authentication and review authentication logs.
What can happen if an attacker logs in to a passwordless account on an affected Alpine image?
A login to a passwordless account can have consequences beyond access to that account. On Alpine's official AWS and Azure images, the default alpine user is marked as passwordless and can use doas without a password. The article says an attacker who reaches that account can therefore obtain root privileges.
The attack begins with the same long-password trick: on a vulnerable server, a password between 257 and 1,024 characters can be accepted for an account whose shadow entry contains an asterisk. If the target is the default alpine user on one of those images, its passwordless doas access provides a route to root.
The risk applies only where the required combination of old OpenSSH, musl, no PAM, and relevant account entries exists. OpenSSH 10.6p2 fixes the flaw. Operators who cannot update immediately can set PasswordAuthentication no and restart sshd. They should also review authentication logs for signs that an account with no password accepted a password.
How did an OpenSSH fix for a 2016 timing attack help create the conditions for this flaw?
The OpenSSH behavior involved in *sshole began with a fix for CVE-2016-6210, a timing attack that could reveal whether a username existed. OpenSSH wanted valid and invalid usernames to take a similar amount of time to process. The workaround helped conceal that difference, but later interacted badly with musl.
To make the response time similar, OpenSSH borrowed a salt from another account and hashed the supplied password anyway. Kultekin says the workaround also applied to real accounts whose shadow entry contained an asterisk. On affected systems, musl can return an asterisk for an overlong password; OpenSSH then risks treating that value as a matching password hash.
The flaw remained unnoticed for roughly a decade, Kultekin writes, because the combination was uncommon in testing. OpenSSH is tested on OpenBSD and glibc-based systems, while many Linux distributions use PAM. OpenSSH 10.6p2 fixes the issue. Kultekin says he found it by building OpenSSH in several configurations and testing about 17,600 unusual login attempts.
What can system operators do to protect affected servers before or after updating OpenSSH?
The direct fix is to update OpenSSH to version 10.6p2. This matters for affected operators because the flaw is being exploited in the wild, and a vulnerable server can accept a long password for an account marked as having no usable password.
If an immediate update is not possible, Kultekin advises setting PasswordAuthentication no in the SSH server configuration and restarting sshd. This disables password authentication as a temporary protective measure. Administrators should also inspect authentication logs for evidence that an account with no password accepted a password, and can use the project's published detection and background repository.
Operators should first identify servers built against musl, check whether PAM is disabled, and review shadow entries for asterisk-marked accounts. Alpine-based containers, embedded devices, and custom musl builds deserve attention even though Red Hat products and Amazon Linux 2 and 2023 are reported as unaffected. These steps address both immediate exposure and signs of earlier exploitation.
How do Linux password hashes and shadow-file entries normally help verify a login?
As general Linux background, a password is normally checked by applying the account's stored hashing settings to the password supplied at login, then comparing the result with the stored value. The article refers to SHA-256 and SHA-512 password hashes in /etc/shadow, and explains that an asterisk in a shadow entry marks an account as having no usable password.
The flaw disrupts that distinction. For an overlong password, musl's crypt() call returns an asterisk as an error value. OpenSSH can treat that character like a match, even though it is not a valid password hash for the passwordless account. A password between 257 and 1,024 characters can then be accepted under the required conditions.
This does not affect every Linux login. The server must use OpenSSH before 10.6p2, musl, and no PAM, with the specified account entries. OpenSSH 10.6p2 fixes the issue. Operators can also disable password authentication temporarily and review logs for unexpected successful logins to asterisk-marked accounts.
This brief was written by AI from the original reporting and checked by other models. Names, figures and quotes come from the source; read it for full context.
Read more in the JupiteX app
Pulse is free. New stories every 4 hours, each one broken into the questions that explain it.
Or read more news on the web