Reported by 4 sources

The short version

  • The vulnerability affects systems running OpenSSH with the musl library, particularly Alpine Linux configurations that do not use PAM.
  • Attackers can gain access to passwordless accounts by submitting a string of more than 256 characters, bypassing authentication entirely.
  • While root accounts are generally protected by default settings, the flaw poses significant risks to embedded devices and container images.

A critical security vulnerability dubbed 'sshole' has emerged in OpenSSH configurations that utilize the musl C library, exposing certain Linux systems to unauthorized access without passwords. The flaw, which has existed for approximately a decade, specifically targets environments where OpenSSH is paired with musl—a lightweight alternative to the standard libc library—and does not employ Pluggable Authentication Modules (PAM). Alpine Linux, a widely used distribution known for its minimal footprint, is among the primary systems affected, though other distributions using similar configurations may also be vulnerable.

The exploitation of this vulnerability requires a specific set of conditions. First, the target system must have at least one user account accessible via a password hashed using SHA256 or SHA512 functions. Second, the account intended for intrusion must be configured as passwordless, typically indicated by an asterisk in the password field of the /etc/shadow file. This configuration is common for accounts relying on certificate-based authentication. When these criteria are met, an attacker can log in to the system from a single connection without needing to know any password or retry attempts.

News Journal

The mechanism behind the breach involves inputting more than 256 characters into the password field during the login attempt. According to Alpine maintainers, this action allows the attacker to bypass authentication checks entirely. Security researchers from Checkpoint noted that the presence of SHA256 or SHA512 hashes is crucial because the sshd process borrows the salt from those accounts; without it, the attack fails. Additionally, the target account must be active, not merely holding a hash in the system files.

Despite the stringent prerequisites, the potential impact is substantial due to the widespread adoption of Alpine Linux. The Docker Hub base image for Alpine has recorded over one billion downloads, indicating its prevalence in containerized environments. Beyond containers, Alpine is frequently deployed in routers, smart TVs, industrial controllers, and other embedded devices. Many of these systems are difficult or impossible to update, leaving them perpetually exposed if they meet the vulnerability's conditions.

The ease of exploitation has heightened concerns among security professionals. Detectify reported that Shodan lists approximately 22 million systems with SSH open on port 22. While only a fraction of these will meet the specific criteria for sshole, the simplicity and speed of testing each system mean that locating vulnerable devices requires minimal effort or time. An attacker can reach the SSH port and gain entry in one attempt, making automated scanning highly effective.

Root accounts are generally considered safe under default configurations, specifically when PermitRootLogin is set to prohibit password authentication. However, this protection does not extend to all privileged access. Accounts with doas or sudo rights remain vulnerable, allowing attackers who breach a standard user account to potentially escalate privileges and gain root access. This distinction highlights the importance of reviewing privilege escalation paths in addition to direct login security.

The discovery has sparked significant discussion within the developer community, particularly on platforms like Hacker News, where the topic trended prominently. The vulnerability underscores the risks associated with lightweight Linux distributions that prioritize efficiency over comprehensive security frameworks like PAM. As Alpine continues to gain traction in desktop and server environments, the sshole flaw serves as a stark reminder of the hidden dangers in legacy code interactions.

It remains unclear exactly where the vulnerability resides within the codebase, as initial reports focus on the interaction between OpenSSH and musl rather than a single defective component. Developers are advised to audit their systems for passwordless accounts and consider implementing PAM or switching libraries if feasible. For embedded devices that cannot be updated, network-level restrictions may be necessary to mitigate the risk of unauthorized SSH access.

The incident highlights the ongoing challenge of maintaining security in diverse Linux ecosystems. While musl offers performance benefits for resource-constrained devices, its integration with OpenSSH introduces unique attack vectors that standard distributions do not face. As patches and workarounds are developed, system administrators must remain vigilant against this decade-old flaw that has only recently come to light.

Sources behind this briefing

Go to the original reporting

  • Ars Technica↗Meet *sshole, the vulnerability that lets hackers SSH into Linux devices
  • SC Media↗Security vulnerability discovered in OpenSSH on musl-based Linux systems
  • GBHackers News↗OpenSSH sshole Flaw Allows Hackers to Log Into Password-Disabled Linux Accounts Using 257-Character Passwords
  • Pasquale Pillitteri↗OpenSSH Alpine Bug Lets a Long Password Unlock Locked Accounts