Skip to content
STIRUP

TECHNOLOGY INTELLIGENCE

Understand what's next.

Alpine Linux and musl-based systems face decade-old SSH vulnerability

A decade-old vulnerability in Alpine Linux and other musl-based systems allows attackers to bypass password authentication through a flaw in OpenSSH's handling of password verification errors.

Share
AI-generated conceptual illustration accompanying: Alpine Linux and musl-based systems face decade-old SSH vulnerability
AI-generated editorial illustration of the article topic; not a photograph, product screenshot or measured result.

Vulnerability Overview and Technical Context

Devices running certain configurations of Alpine Linux, and potentially other distributions, are affected by a decade-old vulnerability that allows attackers to log into systems without requiring a password. The flaw stems from the interaction between OpenSSH and musl, a lightweight C library used in Alpine Linux and other embedded systems. Security researcher Ozgun Kultekin discovered the issue, which has existed since 2016, and attributes it to how OpenSSH handles password verification errors on systems using musl. Specifically, the musl C library's crypt() function returns * when password hashing fails, including when a submitted password exceeds its 256-byte limit. Exploitation requires OpenSSH to be running on a musl-based system, such as Alpine Linux, OpenWrt, Buildroot, or Yocto, and for PAM authentication to be disabled, which is the default in Alpine Linux's openssh-server package.

Conditions for Exploitation and System Impact

The *sshole vulnerability requires specific conditions to be exploited. First, a system must have at least one user account with a password hashed using SHA256 or SHA512. Second, the target account must be configured for passwordless access, indicated by an asterisk (*) in the password field of /etc/shadow. Passwordless accounts are often used for certificate-based authentication. According to the researcher, Alpine Linux's official AWS and Azure cloud images have an affected default 'alpine' account with passwordless 'doas' privileges, potentially allowing root access. However, systems using glibc (such as Debian, Ubuntu, and Fedora) and those using PAM authentication are not vulnerable to this attack.

Discovery, Mitigation, and Affected Systems

The vulnerability, dubbed *sshole, was discovered by Kultekin using AI agents that conducted approximately 17,600 authentication tests with various OpenSSH configurations, malformed password hashes, and oversized passwords (bleepingcomputer.com). The issue has been resolved in OpenSSH 10.6p2, and Alpine Linux administrators are advised to update their OpenSSH packages using apk upgrade openssh (bleepingcomputer.com). For those unable to immediately install the update, disabling SSH password authentication by setting PasswordAuthentication no in the SSH server configuration and restarting SSH can serve as a mitigation strategy (bleepingcomputer.com). Admins can also check for signs of exploitation by examining SSH authentication logs for password-based logins for accounts that should not allow them (bleepingcomputer.com). On Alpine Linux, the command grep "Accepted password" /var/log/messages can reveal successful SSH password logins (bleepingcomputer.com).

Developer and Community Responses

Developer and community responses to the *sshole vulnerability have been varied. OpenSSH, which released an update on Thursday, stated that the root cause of the bug lies outside of sshd, though it is exploitable through sshd and can be mitigated there. Meanwhile, Musl developer Rich Felker argued that the issue is not a bug in musl itself, but rather an erroneous use by the caller. Felker noted that musl developers have long wanted to make changes to the mechanism and planned to implement them in an upcoming release. The vulnerability’s discoverer indicated that OpenWRT is affected, though it typically uses Dropbear for SSH connections. Buildroot and Yocto were also named as potentially affected, though this has not been confirmed. The discoverer urged users of Linux systems that combine musl and OpenSSH to investigate whether they are impacted.

Scope and Potential Reach of the Vulnerability

The *sshole vulnerability, discovered by security researchers, has the potential to affect a significant number of systems, particularly those running Alpine Linux and other musl-based distributions. According to Detectify, Shodan lists approximately 22 million systems with SSH open on port 22, though only a fraction of these are likely vulnerable. However, the ease with which attackers can scan and identify exploitable devices means that the vulnerability could be widely exploited. Alpine Linux is commonly used in embedded systems such as routers, smart TVs, and industrial controllers, many of which are difficult or impossible to update. This makes the vulnerability particularly concerning, as affected devices may remain exposed for extended periods. The flaw allows attackers to bypass password authentication by using an oversized password, exploiting a specific configuration in OpenSSH and musl. As noted by the researcher who discovered the vulnerability, the potential reach of *sshole is considerable, even if not all systems are immediately at risk.

Sources and reporting notes

Based on published source material. No independent hands-on testing is claimed.

Read more