
Research and detection toolkit for CVE-2026-123158 (SSHole), an OpenSSH password authentication bypass affecting certain musl-based Linux systems with PAM disabled. Includes a Python proof of concept and a read-only Alpine Linux exposure checker.
OpenSSH Password Authentication Bypass on musl-based Linux Systems
A security research and detection project exploring CVE-2026-123158, also known as SSHole.
This repository contains a Python-based proof of concept and a read-only shell checker to help security researchers and system administrators understand and assess potentially affected Alpine Linux systems.
CVE-2026-123158 is an OpenSSH password authentication bypass affecting certain Linux systems that use musl libc with PAM authentication disabled.
The vulnerability occurs because of how OpenSSH handles the return value from the crypt() function when processing specially sized passwords.
On affected musl-based systems, crypt() returns * as an error indicator when the supplied password exceeds the supported length. Since * can also appear as the stored password field for accounts without a usable password hash, the comparison can result in successful authentication.
The issue is configuration-dependent. Merely running Alpine Linux or using musl libc does not automatically make a system vulnerable.
This project was developed to:
| Attribute | Details |
|---|---|
| CVE | CVE-2026-123158 |
| Nickname | SSHole |
| Component | OpenSSH |
| Affected environment | Linux using musl libc without PAM |
| Vulnerability type | Authentication bypass |
| CWE | CWE-394, Unexpected Status Code or Return Value |
| Upstream fixed version | OpenSSH 10.6p2 |
| Alpine fixed packages | Release-specific backported packages |
The vulnerability requires a combination of specific system and authentication configurations.
All the following conditions must be satisfied:
1. musl libc
The SSH server must run on a Linux environment using musl libc.
Alpine Linux is a prominent example.
2. PAM authentication disabled
The SSH server must use the non-PAM password authentication implementation.
On Alpine, the standard openssh-server package is built without PAM. The PAM-enabled package is also potentially affected if UsePAM no is configured.
3. Password authentication enabled
The effective SSH configuration must have:
PasswordAuthentication yes
4. Account with a * password field
At least one target account must have * as its stored password field in /etc/shadow.
For example:
labuser:*
This represents an account without a usable password hash.
5. Another account with a real password hash
At least one local account must have a $5$ or $6$ password hash.
For example:
hashuser:$6$randomsalt$hashedvalue
This allows sshd to obtain a salt while processing accounts whose stored password fields are too short.
6. Vulnerable, unpatched OpenSSH
The server must not contain the upstream fix or an equivalent distribution backport.
The Alpine package version must be checked against the fixed version for its specific release branch.
When PAM is disabled, OpenSSH performs password verification using the system's crypt() implementation.
On affected musl-based systems, an overlong password causes crypt() to return:
*
This is an error indicator, not a valid password hash.
However, * is also used in the shadow database for accounts that do not have a usable password hash.
When the authentication code compares these values without correctly handling the error return, the comparison can succeed.
The result is an authentication bypass affecting accounts that would otherwise reject password-based authentication.
The underlying issue is not a conventional buffer overflow. It is an authentication logic flaw caused by incorrect handling of an unexpected return value.
The underlying vulnerability is not exclusive to Alpine Linux.
The relevant factor is the combination of musl libc, OpenSSH, disabled PAM, and the required account configuration.
| Environment | Exposure considerations |
|---|---|
| Alpine Linux | Confirmed affected platform when all prerequisites are present |
| Alpine-based Docker containers | Relevant when the container runs a vulnerable sshd |
| OpenWrt | Uses musl in common configurations, but many installations use Dropbear instead of OpenSSH |
| Buildroot | Depends on the selected libc, SSH implementation, and build configuration |
| Yocto | Depends on the selected distribution configuration and packages |
| Embedded Linux devices | Potential exposure where the vulnerable OpenSSH and authentication configuration are present |
| Standard glibc-based distributions | Do not meet the musl prerequisite |
Important: These environments should not automatically be classified as vulnerable. Their actual OpenSSH implementation, libc, PAM configuration, package version, and account state must be verified.
Alpine is commonly used as a lightweight base image for Docker containers.
However, containers that do not run an SSH server are not affected through this vulnerability.
The relevant scenarios are containers that include OpenSSH, run sshd, and satisfy the authentication prerequisites.
A minimal Alpine application container without sshd should not be classified as vulnerable merely because it uses musl libc.
Location:
poc/cve-2026-123158-poc.py
A Python-based proof of concept using Paramiko to demonstrate the authentication behavior.
The current implementation uses a short-password authentication attempt followed by an overlong-password attempt on the same SSH transport.
The PoC is intended for controlled, authorized reproduction only.
Requirements:
Install the dependency:
python3 -m pip install paramiko
Run against an authorized test environment:
python3 poc/cve-2026-123158-poc.py \
--host 127.0.0.1 \
--port 2222 \
--user labuser
The default port and host should be adjusted to match your isolated test environment.
A successful authentication demonstrates the reproduced behavior in that environment. It does not establish that every system using musl is vulnerable.
Location:
checker/alpine-cve-check.sh
A read-only shell script designed to inspect relevant Alpine Linux and OpenSSH configuration conditions.
The checker evaluates:
* in /etc/shadow.$5$ or $6$ password hashes.Run the checker as root:
chmod +x checker/alpine-cve-check.sh
sudo ./checker/alpine-cve-check.sh
| Exit code | Meaning |
|---|---|
| 0 | No exposure indicated by the conditions checked |
| 1 | Potentially exposed configuration detected |
| 2 | Indeterminate or unable to perform required checks |
Checker limitations
The current checker is a preliminary configuration assessment, not a definitive exploitability test.
It does not currently validate the installed OpenSSH package against Alpine's release-specific fixed package versions.
It also does not comprehensively evaluate conditional Match configurations, directory-service accounts, or every possible account access restriction.