OpenSSH sshd Password Authentication Bypass on musl libc (CVE-2026-123158)
Overview
OpenSSH's sshd daemon on Linux platforms built with musl libc and without PAM support fails to correctly differentiate between a password hash and a plaintext password for certain configurations. This flaw, present in releases prior to 10.6p2, can be triggered by supplying a password of sufficient length, allowing an attacker to authenticate without knowing the actual password.
Technical Details
The weakness stems from a misinterpretation of the supplied string as a password hash when musl libc is used without PAM. For accounts configured in a way that triggers this code path, any password whose length falls between 256 and 1024 characters is treated as valid, regardless of the real credential. The issue is confined to OpenSSH versions earlier than 10.6p2 on Linux systems that employ musl libc and have PAM disabled, such as many Alpine Linux installations.
Impact
An attacker who can connect to an affected SSH service could gain unauthorized remote access by simply providing a long password string. This grants the same privileges as the targeted account, potentially exposing confidential data, allowing lateral movement, or enabling further compromise of the host. All Linux systems using the vulnerable OpenSSH configuration are at risk.
Recommended Actions
- Patch the OpenSSH package to version 10.6p2 or later.
- Restrict SSH access to trusted IP ranges or VPN connections.
- Disable the use of musl libc without PAM for OpenSSH if patching is delayed.
- Monitor SSH authentication logs for unusually long password attempts.
Detection
Review sshd logs for authentication entries where the password length exceeds typical values (e.g., >255 characters) or where authentication succeeds unexpectedly. Correlate these events with source IPs and account names to identify potential exploitation attempts. Enable verbose logging in sshd to capture authentication details for further analysis.