
Python proof-of-concept for CVE-2026-123158 (SSHole), an OpenSSH password authentication bypass on musl libc systems without PAM, with root cause analysis and mitigation notes.
CVE-2026-123158 | CVSS 3.1: 8.1 (High)
An authentication bypass in OpenSSH affecting Linux systems running musl libc without PAM.
SSHole is a password authentication bypass affecting OpenSSH's sshd implementation on Linux systems using musl libc without PAM.
The vulnerability originates from an interaction between OpenSSH's internal password verification logic and musl's crypt() implementation.
When a specially sized password is processed, musl's crypt() can return the literal string * instead of a valid password hash. OpenSSH does not correctly distinguish this error result from a legitimate stored password value.
For accounts whose shadow password field contains *, the comparison can consequently succeed.
An unauthenticated remote attacker can exploit this behaviour to bypass SSH password authentication and gain access to affected accounts.
The vulnerability is tracked as CVE-2026-123158.
| Attribute | Details |
|---|---|
| Name | SSHole |
| CVE | CVE-2026-123158 |
| Component | OpenSSH sshd |
| Vulnerability Type | Password Authentication Bypass |
| CWE | CWE-394 |
| CVSS 3.1 | 8.1 High |
| Attack Vector | Network |
| Attack Complexity | High |
| Privileges Required | None |
| User Interaction | None |
| Affected Platform | Linux |
| C Library | musl libc |
| Authentication | Internal password authentication without PAM |
| Fixed Upstream Version | OpenSSH 10.6p2 |
CVSS Vector:
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
The vulnerability affects OpenSSH versions before 10.6p2 when running on Linux with musl libc and without PAM.
However, the authentication bypass requires additional account and configuration conditions.
The following conditions must be satisfied:
PasswordAuthentication is enabled.*.For root authentication, PermitRootLogin yes must also be configured.
An account containing ! in its shadow password field is not equivalent to an account containing * for this vulnerability.
These platforms are not automatically vulnerable. Their OpenSSH build, authentication configuration and account database must satisfy the required conditions.
When PAM is disabled, OpenSSH performs password verification internally.
The authentication process involves the following operations:
sshd retrieves the target account's stored password field.crypt().The relevant implementation is found in:
auth-passwd.c
openbsd-compat/xcrypt.c
openbsd-compat/port-uw.c
An important part of the vulnerability is how OpenSSH handles accounts without a usable password hash.
When the target account has a short password field, OpenSSH does not use that field directly as a cryptographic salt.
Instead, the compatibility implementation can select a salt from another local account containing a valid password hash.
The relevant function is:
pick_salt()
This behaviour originated from earlier password-authentication timing protections, including work associated with CVE-2016-6210.
For SSHole, this salt-selection behaviour becomes part of the vulnerable execution path.
musl's SHA-256 and SHA-512 password hashing implementations impose a maximum password input length of 256 bytes.
When an input exceeds this limit, the hashing operation fails.
Instead of returning a valid password hash, musl's crypt() returns:
*
This value is an error marker.
It is not a valid SHA-256 or SHA-512 password hash.
However, * is also commonly used in shadow password fields to represent accounts without a usable password.
This creates the conditions for the authentication bypass.
The vulnerable authentication path ultimately compares the result returned by crypt() with the stored password field.
Conceptually:
encrypted_password = xcrypt(password, salt);
return encrypted_password != NULL &&
strcmp(encrypted_password, pw_password) == 0;
Under the vulnerable conditions:
Target account password field: *
musl crypt() result: *
String comparison: MATCH
The error marker is incorrectly treated as a successful password verification result.
This is the central failure behind SSHole.
The issue is not a cryptographic collision, password cracking technique or memory corruption vulnerability.
It is an authentication logic error caused by interpreting an invalid return value as a valid password hash.
The documented vulnerable input range is 256–1024 characters in the CVE description. Independent reproduction has demonstrated successful authentication with inputs of 257–1024 bytes.
The upper boundary is associated with OpenSSH's password input limit.
An additional implementation detail is relevant to reproducing the vulnerability.
Independent source-level reproduction identified an interaction involving pick_salt() and musl's shadow-password handling.
During the first authentication attempt:
The selected salt is cached by pick_salt().
On a subsequent attempt within the same SSH connection, the cached salt avoids the same shadow-entry traversal.
The target account's stored * value remains available for the comparison.
This behaviour has been reproduced in controlled environments. It should not be confused with a requirement that every vulnerable installation necessarily exhibits identical logging or client behaviour.
---
## Root Cause Summary
The vulnerability requires three interacting behaviours:
| Component | Behaviour |
|---|---|
| OpenSSH | Selects an alternative salt when the target account has no usable hash |
| musl libc | Returns `*` when the supported password hashing operation fails |
| Shadow password database | Can contain `*` as an account's password field |
Individually, these behaviours have legitimate purposes.
The vulnerability emerges when their interaction allows an error marker to satisfy the password comparison.
---
## Proof of Concept
This repository contains a Python proof of concept for CVE-2026-123158.
```text
.
└── exploit.py
The script is intended for controlled vulnerability verification against authorized SSH services.