OpenSSH Authentication Bypass on musl Linux – SSHole (CVE-2026-123158)

SSHole is a critical OpenSSH authentication bypass on musl Linux systems such as Alpine that lets an unauthenticated attacker log in to accounts with no password set. OpenSSH fixed it in version 10.6p2, and Alpine has published fixed packages.

Vulnerability

A critical authentication bypass vulnerability known as SSHole affects OpenSSH on Linux systems built on musl libc, such as Alpine Linux.

The flaw lets a remote, unauthenticated attacker log in to accounts that have no password set, using any password between 257 and 1,024 bytes long. That includes SSH key-only accounts and, in certain configurations, the root account.

The root cause lies in an interaction between three design decisions that are each reasonable on their own.

First, OpenSSH was changed to prevent username enumeration (CVE-2016-6210). A login attempt may target an account with no valid password hash, for example one with only * in its shadow entry. In that case, sshd borrows the salt from another account that has a real hash. This keeps timing consistent whether or not the account has a valid password.

Second, musl’s crypt() function was changed to return an unmatchable hash (*) rather than NULL on failure, because many programs didn’t check for NULL.

Third, a change on August 29, 2012, added a hard limit of 256 bytes on password length. It was meant to mitigate denial of service through expensive hash computation. When a password exceeds 256 bytes, musl’s crypt() silently returns * without hashing.

When an attacker targets an account with * in its shadow entry, sshd borrows a $5$ or $6$ salt from another account. It then calls crypt() with the attacker’s password. If that password is longer than 256 bytes, musl returns *.

sshd then compares *, the result of crypt(), against *, the stored value. It finds them equal and grants access. The attack works with any password between 257 and 1,024 bytes, which is the maximum sshd accepts.

Accounts with a real password hash aren’t affected, because their stored value is a full hash string, not *.

CVE and severity

The vulnerability is tracked as CVE-2026-123158.

OpenSSH has rated the flaw critical.

Impact

A successful attacker logs in to an account with no password set, without credentials. Accounts at risk on a default Alpine installation include:

  • Key-only users created with adduser without a password, or set with usermod -p '*'.
  • root, which ships as root:* in base images since Alpine 3.16. It’s protected by PermitRootLogin prohibit-password by default, but exploitable if that setting is changed.
  • The alpine user in official tiny-cloud images, which is exposed once any $6$ hash is present on the machine. On images 3.18.11 to 3.24.3, it can escalate to root through passwordless doas.
  • Users sourced from a directory service through musl-nscd, which have no shadow entry.

Exploit status

Exploitation requires only network access to the server, a valid account name and a suitably long password. No credentials, prior access or user interaction are needed. The attack succeeds on every attempt with a single connection.

As of November 19, 2026, no vetted public detection template had been released.

Affected component and versions

OpenSSH versions before 10.6p2 are affected when deployed on any musl-based Linux system, including Alpine, OpenWrt with OpenSSH installed, Buildroot and Yocto.

On Alpine Linux, the openssh-server package built without PAM is affected in these versions:

  • All Alpine Linux versions running openssh-server before the fixed point releases, including the end-of-life 3.16 to 3.20 branches, which have been patched.
  • Alpine 3.21.x: all releases before 3.21.10.
  • Alpine 3.22.x: all releases before 3.22.8.
  • Alpine 3.23.x: all releases before 3.23.8.
  • Alpine 3.24.x: all releases before 3.24.4.
  • Alpine tiny-cloud images 3.18.11 to 3.24.3, which expose the alpine user with passwordless doas once any $6$ hash is present on the machine.

These systems aren’t affected:

  • Non-Linux systems.
  • Linux systems built on glibc, such as Debian, Ubuntu, RHEL and CentOS.
  • Systems with PAM-enabled sshd (openssh-server-pam with UsePAM yes).
  • Systems with PasswordAuthentication no.
  • Containers that don’t run sshd.
  • Cloud images provisioned through cloud-init, which writes PasswordAuthentication no automatically.
  • Accounts locked with ! in /etc/shadow.
  • OpenWrt systems using the default Dropbear SSH daemon, which is unaffected.

Fix and mitigation

OpenSSH released a fix in version 10.6p2. Alpine has published fixed packages for every supported branch back to 3.16, including end-of-life branches.

Upgrade the Alpine openssh-server package to a fixed version and restart sshd. A package upgrade alone doesn’t restart the running daemon:

apk upgrade -U -a

rc-service sshd restart

Fixed point releases by branch:

  • Alpine 3.21: 3.21.10 or later.
  • Alpine 3.22: 3.22.8 or later.
  • Alpine 3.23: 3.23.8 or later.
  • Alpine 3.24: 3.24.4 or later.
  • Branches 3.16 to 3.20 (end-of-life): fixed packages have been backported, and upgrading is recommended.

For upstream OpenSSH, upgrade to version 10.6p2 or later. Container images that pin an OpenSSH or Alpine version must be rebuilt, because a package upgrade inside an unchanged image layer won’t take effect.

Where immediate patching isn’t possible, disable password authentication first. Confirm key-based login works and keep your current session open. Then set PasswordAuthentication no in /etc/ssh/sshd_config, or in a drop-in under /etc/ssh/sshd_config.d/ on Alpine 3.19 and later. Validate with sshd -t and restart sshd.

Confirm the setting is active with:

sshd -T | grep -i passwordauthentication

Additional mitigations:

  • Lock accounts that don’t need SSH login by replacing * with ! in /etc/shadow for any account that shouldn’t authenticate by password.
  • Restrict SSH access at the network perimeter to known source IPs.
  • Review and restrict doas and sudo rules for any account reachable through this vulnerability.
  • Set PermitRootLogin no if direct root SSH isn’t required.
  • Isolate services running on Alpine in network segments with strict inbound SSH rules.
  • Monitor sshd logs for unexpected successful password logins on accounts that should only use key authentication.

To find exposed accounts, look for accounts with * in their shadow entry on a system that also has at least one $5$ or $6$ hash. List accounts with no password (an asterisk-only shadow entry):

awk -F: '$2 == "*" {print $1}' /etc/shadow

Confirm at least one $5$ or $6$ hash exists, which enables the attack:

grep -c ':\$[56]\$' /etc/shadow

Review /var/log/messages for successful password logins on accounts that shouldn’t accept password authentication:

grep 'Accepted password for' /var/log/messages | grep -E 'alpine|root'

References