Skip to content
STIRUP

TECHNOLOGY INTELLIGENCE

Understand what's next.

Emergency Fix Released for OpenSSH Vulnerability in Alpine Linux

OpenSSH has released an emergency fix for a critical vulnerability in Alpine Linux systems, allowing attackers to bypass password authentication on key-only accounts due to an interaction with the musl C library.

Share
AI-generated conceptual illustration accompanying: Emergency Fix Released for OpenSSH Vulnerability in Alpine Linux
AI-generated editorial illustration of the article topic; not a photograph, product screenshot or measured result.

Overview of the Vulnerability and Affected Systems

OpenSSH has released an emergency fix for a critical vulnerability affecting Alpine Linux systems. The flaw, dubbed "*sshole," allows attackers to bypass password authentication on accounts configured to disable password logins, such as SSH key-only accounts. This issue arises due to an interaction between OpenSSH and the musl C library, which is commonly used in Alpine Linux. Attackers can exploit this by submitting an oversized password during the authentication process, effectively bypassing security measures. The vulnerability impacts systems running the standard openssh-server package on Alpine Linux and other musl-based distributions. Security advisories urge users to update the openssh package immediately and restart the sshd service to mitigate the risk. This flaw highlights the importance of timely patch management in securing remote access systems.

Technical Details of the Flaw and Exploitation Conditions

The vulnerability in OpenSSH allows attackers to bypass authentication when specific conditions are met. According to evidence, the attack is possible when the OpenSSH server (sshd) checks passwords without using the Pluggable Authentication Module (PAM) interface, password logins are enabled, and at least one other account on the machine has a password set. Kultekin highlights that exploitation is limited to musl-based Linux systems, such as Alpine Linux, OpenWrt, Buildroot, or Yocto. Additionally, the attacker must know the name of an account with a password field set to * (indicating no password is set, typical for key-only accounts) and the system must have at least one other account with a $5$ or $6$ password hash. These conditions are critical for the flaw to be exploited, emphasizing the need for administrators to apply the emergency fix promptly.

Impact and Specific Affected Accounts on Alpine Linux

The emergency fix for the OpenSSH flaw on Alpine Linux primarily affects accounts that lack password authentication. These include key-only users created with adduser without a password, or those modified with usermod -p '*'. Additionally, users sourced from a directory service via musl-nscd are impacted, as they lack shadow entries. The root account, which has been configured as root:* in Alpine base images since approximately version 3.16, is also affected. The alpine user in official cloud images, such as those built with tiny-cloud, is another concern. According to the researcher, Alpine Linux's official AWS and Azure cloud images include an affected default alpine account with passwordless doas privileges, which could allow attackers to gain root access. These findings highlight the need for immediate patching and password enforcement on affected systems.

Mitigation and Fixes for the Vulnerability

Alpine Linux users are advised to apply an emergency fix for a vulnerability in OpenSSH that allows long passwords to bypass SSH authentication. The mitigation involves updating the OpenSSH package and restarting the sshd service. To update, administrators should run apk upgrade -U -a to ensure all packages are current. Following the update, the sshd service must be restarted using rc-service sshd restart to apply the changes. Point releases of Alpine Linux, including versions 3.21.10, 3.22.8, 3.23.8, and 3.24.4, already include the fixed package. OpenSSH 10.6p2 also addresses the vulnerability, and administrators are encouraged to upgrade their OpenSSH packages using apk upgrade openssh for full protection.

Detection and Verification of Exploitation

Detection and verification of exploitation related to the OpenSSH vulnerability on Alpine Linux involves examining system logs for suspicious activity. According to the advisory, administrators should check /var/log/messages for lines containing Accepted password for accounts that should not have password authentication enabled, such as alpine, root, or key-only users. A specific command to identify successful SSH password logins is grep "Accepted password" /var/log/messages. If logs indicate a successful password login for the alpine account, administrators should verify whether password authentication is disabled for that user by running grep '^alpine:' /etc/shadow. If the password field contains an asterisk (*) but SSH logs show a successful password login, this may suggest the vulnerability was exploited. These steps help confirm whether the flaw was used to bypass SSH authentication mechanisms.

Sources and reporting notes

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

Read more