Skip to content
/
Suscribirse Subscribe

CVE-2026-123158 (*sshole) in OpenSSH & Alpine Linux: How 257 Bytes Make musl Return '*' and Hand Over a Shell

How CVE-2026-123158 (*sshole) abuses musl crypt() returning '*' for >256-byte passwords on Alpine Linux without PAM—and the OpenSSH 10.6p2 fix.

CVE-2026-123158 (*sshole) in OpenSSH & Alpine Linux: How 257 Bytes Make musl Return '*' and Hand Over a Shell

(🇪🇸 Leer la versión en español aquí)

Every container team loves bragging about shaving a few megabytes off Docker images by swapping Debian for Alpine Linux, OpenWrt, or embedded musl libc builds. It looks lean right up until an undocumented crypt(3) error convention collides with a 2016 anti-enumeration fallback in OpenSSH and hands over an interactive login without a single valid password.

That is the exact anatomy of CVE-2026-123158—dubbed "sshole" on oss-security after being reported by researcher Özgün Kültekin and shipped out-of-band in Portable OpenSSH 10.6p2 on November 5, 2026.

Inside auth-passwd.c: Why musl Turns an Error Into a Valid Match

There is no memory corruption, heap spray, or ROP chain here—just two legacy assumptions quietly blowing up together inside sys_auth_passwd():

  1. On musl libc, passing a candidate password longer than 256 bytes (well under OpenSSH's MAX_PASSWORD_LEN ceiling of 1,024 bytes) causes crypt() to fail and return the literal error string "*" instead of NULL.
  2. Because of anti-username-enumeration hardening introduced back in 2016, OpenSSH avoids short-circuiting before xcrypt() even for accounts whose /etc/shadow password field is set to "*" (locked or SSH-key-only accounts). openbsd-compat/xcrypt.c even borrows a genuine $5$ or $6$ salt from another local account via pick_salt() so timing stays uniform.
  3. On systems built and run without PAM—the default on stock Alpine containers, OpenWrt, and minimal Yocto/Buildroot appliances—if PasswordAuthentication yes remains enabled, strcmp(encrypted_password, pw_password) == 0 evaluates "*" == "*" and returns 1.
CVE-2026-123158 OpenSSH musl crypt(*) authentication bypass vs 10.6p2 patch

Exposure Matrix and the Three-Line Patch

Not every Linux host is exposed, and kernel versions are irrelevant here. According to the Debian Security Tracker and Damien Miller's commit 4353fdc43e, exploitability boils down to four concrete runtime gates:

Host Condition Vulnerable State (< 10.6p2) Hardened / Patched State Runtime Reality
C Library & PAM musl libc (Alpine, OpenWrt, Buildroot) with PAM disabled glibc or PAM-enabled build (UsePAM yes) musl crypt() emits "*" past 256 bytes
SSH Auth Policy PasswordAuthentication yes (upstream default) PasswordAuthentication no (keys/FIDO2 only) Shuts off password auth codepath entirely
/etc/shadow State Target account has "*" + another account has $5$/$6$ hash Standard hashes only or patched validation strcmp("*", "*") == 0 grants login
OpenSSH Binary < 10.6p2 (no minimum stored hash check) >= 10.6p2 (MIN_PASSWORD_HASH_LEN = 4) Rejects "*" and any marker < 4 chars

Reading the upstream auth-passwd.c diff, the fix could not be cleaner: OpenSSH introduces #define MIN_PASSWORD_HASH_LEN 4 and enforces strlen(pw_password) >= MIN_PASSWORD_HASH_LEN before comparing hashes, alongside freezero() cleanup and plugging a memory leak in pick_salt(). A one-byte sentinel like "*" can never again masquerade as a password digest.

Production Reality Check: Why OpenSSH Switched to Rapid Out-of-Band Releases

The quiet bomb buried inside the OpenSSH 10.6p2 release notes has nothing to do with musl: Damien Miller explicitly noted that OpenSSH is seeing a wave of AI-assisted bug reports—and multiple cases where bugs surfaced by AI models were independently rediscovered by external researchers shortly after. Because uncooperative adversaries have the same tooling, OpenSSH moved to faster, more frequent security releases rather than batching fixes until the next major train.

If you run sshd inside Alpine bastions, CI jump hosts, or network appliances:

  1. Inspect the live daemon flags instead of guessing from Dockerfile defaults: sshd -T | grep -iE 'passwordauthentication|usepam'.
  2. Enforce SSH keys + PasswordAuthentication no across every internet-facing or internal bastion; if any human-facing app still requires passwords, sanity-check them client-side with our local password entropy auditor (or inspect sensitive configs offline in the private Cron/Regex/JSON validator).
  3. Upgrade packages (apk upgrade --no-cache openssh) and restart sshd, because an already-running daemon holds the unpatched sys_auth_passwd() binary in RAM until cycled. You can browse all our infrastructure calculators and zero-tracking utilities at Syncroma Tools.

CVE-2026-123158 is a textbook reminder from the trenches: shrinking container footprints down to bare musl without turning off PasswordAuthentication yes turns a tiny crypt(3) discrepancy into a remote root footgun.

Visual Credits: Editorial photograph and localized technical infographic by Syncroma Studio.

Newsletter Newsletter

Sistemas reales, sin humo corporativo Real systems, zero corporate hype

Recibe los análisis a fondo sobre arquitectura, consumo de recursos y computación de bajo nivel directamente en tu bandeja de entrada. Get deep-dive software architecture, resource consumption metrics, and low-level computing essays delivered straight to your inbox.

Suscribirse a Syncroma Subscribe to Syncroma
Suscribirse Subscribe