Back to All Articles
Cybersecurity

sshole (CVE-2026-123158): Is Your musl Host Actually Exploitable? Audit Script, the Restart Trap, and Log Forensics

OpenSSH before 10.6p2 on musl Linux without PAM accepts any password longer than 256 bytes for passwordless accounts. Here is the full vulnerability breakdown, the 4 mandatory preconditions, an audit script, the patch-and-restart trap, and log forensic signatures.

Pathubs Engineering
Pathubs Engineering
Database & Systems Architecture
Published Nov 9, 2026Updated Nov 9, 202611 min read
Technical DevSecOps diagram illustrating sshole CVE-2026-123158 OpenSSH password authentication bypass on musl libc, depicting buffer boundaries and audit verification steps.

TL;DR & Threat Context

On November 5, 2026, the OpenSSH project released version 10.6p2 to address a critical authentication bypass designated CVE-2026-123158 (informally dubbed sshole). Under specific circumstances on Linux hosts running the musl libc C library, OpenSSH accepts any password longer than 256 bytes for an account that has no password set. An attacker needs exactly one connection, no brute-forcing, and no retries.

However, despite initial sensationalism across social media, this is not a "patch everything" panic. The vulnerability requires a specific conjunction of four distinct preconditions:

  • glibc systems are immune: Debian, Ubuntu, Fedora, RHEL, CentOS, Arch, and SUSE are completely unaffected.
  • PAM-enabled sshd builds are immune: Any OpenSSH daemon built or configured to authenticate via Pluggable Authentication Modules (PAM) does not traverse the vulnerable code path.
  • The patch-and-restart trap: Installing the updated package (apk upgrade) replaces the disk binary but leaves the in-memory `sshd` listening daemon unpatched. Until sshd is explicitly restarted, the vulnerable code continues accepting logins.
  • Active exploitation in the wild: Security firm Previdian detected active exploitation attempts against its internet honeypots less than nine hours after the CVE disclosure, including a confirmed root compromise on an unpatched Alpine honeypot. Public exploit code is circulating online; administrators should refrain from downloading unvetted GitHub proofs-of-concept, which frequently conceal secondary malware droppers.

---

Are You Exposed? The Four Mandatory Preconditions

According to Alpine Linux's official security advisory, a host is exploitable if and only if all four of the following conditions hold simultaneously:

text
┌──────────────────────────────────────────────────────────────────────────────────────────────────┐
│                             CVE-2026-123158 PRECONDITION MATRIX                                  │
├────┬─────────────────────────────┬──────────────────────────────────────────────────────────────┤
│ #  │ PRECONDITION                │ ARCHITECTURAL ORIGIN                                         │
├────┼─────────────────────────────┼──────────────────────────────────────────────────────────────┤
│ 01 │ sshd is linked against musl │ Alpine Linux, Void Linux (musl), OpenWrt, Buildroot, Yocto   │
│ 02 │ sshd checks passwords       │ Alpine's default openssh-server build;                       │
│    │ directly, without PAM       │ openssh-server-pam only if explicitly configured UsePAM no   │
│ 03 │ PasswordAuthentication yes  │ The standard OpenSSH default configuration                   │
│ 04 │ Target account has '*' in   │ Key-only accounts, default 'alpine' user on tiny-cloud,      │
│    │ /etc/shadow AND at least    │ system users, combined with at least one existing            │
│    │ one other account has a     │ valid password hash ($5$ or $6$) on the system               │
│    │ real $5$ or $6$ hash        │                                                              │
└────┴─────────────────────────────┴──────────────────────────────────────────────────────────────┘
mermaid
flowchart TD
    A[SSH Connection Received] --> B{Linked against musl?}
    B -- No (glibc) --> Z1[IMMUNE: glibc handles errors differently]
    B -- Yes --> C{UsePAM yes?}
    C -- Yes --> Z2[IMMUNE: PAM path never routes * through crypt]
    C -- No --> D{PasswordAuthentication yes?}
    D -- No --> Z3[IMMUNE: Password logins rejected globally]
    D -- Yes --> E{Target account has '*' in /etc/shadow?}
    E -- No --> Z4[IMMUNE: Requires standard password verification]
    E -- Yes --> F{Any OTHER account has $5$ or $6$ hash?}
    F -- No --> Z5[IMMUNE: Cannot borrow valid salt for timing check]
    F -- Yes --> VULN[EXPLOITABLE: Password > 256 bytes hashes to '*' and matches]

    classDef safe fill:#2e7d32,stroke:#1b5e20,color:#fff;
    classDef danger fill:#c62828,stroke:#b71c1c,color:#fff;
    classDef step fill:#1565c0,stroke:#0d47a1,color:#fff;

    class Z1,Z2,Z3,Z4,Z5 safe;
    class VULN danger;
    class A,B,C,D,E,F step;

Understanding Condition 4: The Borrowed Salt Requirement

Condition 4 is the nuance most frequently overlooked by security scanners. To prevent username-enumeration timing attacks (a mitigation introduced in OpenSSH following CVE-2016-6210), when an unauthenticated user attempts to log into an account that has no password (represented by * in /etc/shadow), OpenSSH does not immediately drop the connection.

Instead, sshd computes a dummy hash to burn CPU cycles equivalent to a real verification. To do this, OpenSSH borrows the salt string from another account on the system that possesses a real `$5$` (SHA-256) or `$6$` (SHA-512) password hash.

If a machine has zero accounts with $5$ or $6$ hashes (for instance, an immutable appliance where all accounts are strictly key-only or locked with !), sshd cannot execute this calculation, and the bypass cannot trigger. However, as soon as a single user account sets a password, every passwordless account on that machine immediately becomes accessible.

The Root User and Privilege Escalation Paths

Alpine Linux has configured the root account with root:* since version 3.16. However, OpenSSH's default configuration enforces:

sshd_config
PermitRootLogin prohibit-password

Because prohibit-password rejects password-based authentication for root outright, a standard Alpine installation does not permit direct root login via this exploit.

The primary operational danger is lateral access leading to privilege escalation. On Alpine's official tiny-cloud images, the default alpine user is created with * as its password and granted passwordless doas privileges (permit nopass :wheel). An attacker who logs in as alpine using a 257-byte string instantly possesses root privileges:

bash
doas su -

Containers vs. Virtual Machines

  • Alpine Application Containers: The overwhelming majority of containerized microservices running on Alpine (FROM alpine:latest, node:alpine, python:alpine) do not run `sshd` at all. Alpine has confirmed that containers without an active SSH daemon are entirely unaffected.
  • Containers Running SSH: The danger is concentrated in containers explicitly configured with openssh-server: bastion jump boxes, containerized CI/CD test runners, development containers, and legacy embedded systems. These environments must be updated and their services restarted immediately.
  • OpenWrt, Buildroot, and Embedded Systems: OpenWrt utilizes Dropbear by default. Rich Felker (musl's primary maintainer) has confirmed that Dropbear does not share this logic and is unaffected. OpenWrt is vulnerable only if an administrator manually replaced Dropbear with openssh-server.

---

Automated Host Audit Script: `sshole-audit.sh`

To inspect infrastructure quickly without modifying system state, deploy this read-only POSIX shell script. Run it as root on any host or inside any container running OpenSSH:

sh
#!/bin/sh
# sshole-audit.sh - report which CVE-2026-123158 preconditions hold on this host.
# Run as root. Read-only: it changes nothing.
# It cannot tell you whether the fix is installed (stable Alpine branches keep an
# old version string and carry a patch), so compare the package version with
# Alpine's advisory and restart sshd after upgrading.
set -u

SSHD=${SSHD:-$(command -v sshd 2>/dev/null || echo /usr/sbin/sshd)}
SHADOW=${SHADOW:-/etc/shadow}
yes_count=0

say() { printf '%-34s %s\n' "$1" "$2"; }

[ -x "$SSHD" ] || { echo "No sshd found at $SSHD: this host does not run OpenSSH."; exit 0; }
[ -r "$SHADOW" ] || { echo "Cannot read $SHADOW: run as root."; exit 2; }

# 1. Is sshd linked against musl?
# (ldd may be missing; the ELF interpreter path embedded in the binary is the fallback)
if ldd "$SSHD" 2>&1 | grep -qi musl || grep -q 'ld-musl' "$SSHD" 2>/dev/null; then
  say "1. sshd linked against musl:" "YES"; yes_count=$((yes_count + 1))
else
  say "1. sshd linked against musl:" "no  -> not affected by this bug"
fi

# Effective configuration (a missing 'usepam' line means PAM support is not built in).
CONF=$("$SSHD" -T 2>/dev/null) || { echo "sshd -T failed: check your sshd_config."; exit 2; }

# 2. Does sshd check passwords without PAM?
if printf '%s\n' "$CONF" | grep -qi '^usepam yes'; then
  say "2. Passwords checked without PAM:" "no  -> PAM path, not affected"
else
  say "2. Passwords checked without PAM:" "YES"; yes_count=$((yes_count + 1))
fi

# 3. Are password logins enabled?
if printf '%s\n' "$CONF" | grep -qi '^passwordauthentication yes'; then
  say "3. PasswordAuthentication:" "YES (global setting)"; yes_count=$((yes_count + 1))
else
  say "3. PasswordAuthentication:" "no  (global; Match blocks can differ)"
fi

# 4. Passwordless account plus at least one real $5$/$6$ hash?
NOPASS=$(awk -F: '$2=="*" {print $1}' "$SHADOW" | tr '\n' ' ')
HASHED=$(awk -F: '$2 ~ /^\$[56]\$/ {print $1}' "$SHADOW" | tr '\n' ' ')
if [ -n "$NOPASS" ] && [ -n "$HASHED" ]; then
  say "4. Passwordless + hashed accounts:" "YES"; yes_count=$((yes_count + 1))
else
  say "4. Passwordless + hashed accounts:" "no"
fi
say "   accounts with '*':" "${NOPASS:-none}"
say "   accounts with \$5\$/\$6\$ hash:" "${HASHED:-none}"

echo
if [ "$yes_count" -eq 4 ]; then
  echo "VERDICT: all four conditions hold. Exploitable unless the fixed openssh is installed AND sshd was restarted."
  echo "Next: apk upgrade -U -a && rc-service sshd restart, or set PasswordAuthentication no."
  exit 1
fi
echo "VERDICT: at least one condition is missing, so the bug does not apply with the settings sshd -T reports."
echo "Still read the Match blocks in sshd_config: they can re-enable password logins for some users or addresses."
exit 0

Script Exit Codes and Diagnostic Output

  • Exit Code `1`: All four preconditions hold. The machine is actively exploitable unless the patched package is installed and the process has been restarted.
  • Exit Code `0`: At least one condition is missing. The host is not exploitable under the reported configuration.
  • Exit Code `2`: Execution error (e.g., script not executed as root, or invalid sshd_config syntax).

Example Diagnostic Output on an Exploitable Alpine Machine:

text
1. sshd linked against musl:       YES
2. Passwords checked without PAM:  YES
3. PasswordAuthentication:         YES (global setting)
4. Passwordless + hashed accounts: YES
   accounts with '*':              root alpine
   accounts with $5$/$6$ hash:     bob

VERDICT: all four conditions hold. Exploitable unless the fixed openssh is installed AND sshd was restarted.
Limitations of Local Script Auditing: 1. Backported Versions: The script cannot determine if a backported patch is active merely from the version number, because Alpine maintains original upstream version identifiers across point releases. 2. Conditional Match Blocks: sshd -T evaluates global defaults. An explicit Match block inside sshd_config (e.g., Match User admin) can re-enable PasswordAuthentication yes for specific actors. 3. Remote Visibility: Network vulnerability scanners can verify that SSH is reachable and accepting password attempts, but cannot inspect /etc/shadow or verify dynamic linker bindings across the network.

---

Patch, Then Restart: Distribution Guidance & Backport Matrix

Alpine Linux backported the security patch across every branch back to version 3.16, including end-of-life releases. Use the table below to verify your installed package:

text
┌────────────────────────────────────────────────────────────────────────┐
│               ALPINE LINUX PATCH VERIFICATION MATRIX                   │
├─────────────────┬──────────────────────────────┬───────────────────────┤
│ ALPINE BRANCH   │ FIXED OPENSSH PACKAGE        │ INCLUDED POINT RELEASE│
├─────────────────┼──────────────────────────────┼───────────────────────┤
│ edge (rolling)  │ 10.6_p2-r0                   │ Rolling repository    │
│ 3.24            │ 10.3_p1-r2                   │ 3.24.4                │
│ 3.23            │ 10.2_p1-r1                   │ 3.23.8                │
│ 3.22            │ 10.0_p1-r11                  │ 3.22.8                │
│ 3.21            │ 9.9_p2-r1                    │ 3.21.10               │
│ 3.20            │ 9.7_p1-r6                    │ Package backport only │
│ 3.19            │ 9.6_p1-r3                    │ Package backport only │
│ 3.18            │ 9.3_p2-r4                    │ Package backport only │
│ 3.17            │ 9.1_p1-r7                    │ Package backport only │
│ 3.16            │ 9.0_p1-r6                    │ Package backport only │
└─────────────────┴──────────────────────────────┴───────────────────────┘

The Remediation Sequence on Alpine Hosts

Execute the following commands as root:

bash
# 1. Update package index and apply backported openssh package
apk upgrade -U -a

# 2. Verify that your installed version matches or exceeds the table above
apk info -v | grep '^openssh'

# 3. CRITICAL: Restart the OpenSSH service
rc-service sshd restart

> [!IMPORTANT]

> The Patch-and-Restart Trap: Package managers like apk update binaries on the filesystem, but do not restart listening services automatically. The active sshd master listener remains in memory executing the vulnerable pre-patch instructions. Until rc-service sshd restart is called, the machine remains completely vulnerable to bypass.

Updating Alpine `tiny-cloud` Instances

Official Alpine tiny-cloud cloud images (qcow2, VHD, AMI) from versions 3.18.11 through 3.24.3 configure an alpine user with * and passwordless doas.

  • On initial boot, these instances are safe because no $5$ or $6$ hashes exist.
  • The moment a user sets an administrative console password or cloud-init provisions a hashed account, the instance becomes fully vulnerable.
  • Upgrading base images does not remediate running virtual machine instances; live instances must be upgraded in place. (Note: instances managed via cloud-init are generally safe if cloud-init wrote PasswordAuthentication no).

---

Immediate Workarounds: If You Cannot Patch Today

If upgrading packages is not immediately possible, disabling password authentication neutralizes the vulnerability completely.

Modern Alpine versions support drop-in configuration files under /etc/ssh/sshd_config.d/:

bash
# 1. Create drop-in configuration directory
mkdir -p /etc/ssh/sshd_config.d

# 2. Force password authentication off globally
echo 'PasswordAuthentication no' > /etc/ssh/sshd_config.d/00-no-passwords.conf

# 3. Test configuration syntax and restart service
sshd -t && rc-service sshd restart

# 4. Verify runtime configuration
sshd -T | grep -i passwordauthentication
# Expected output: passwordauthentication no

Pre-3.19 Alpine Legacy Workaround

On Alpine 3.18 and older, edit /etc/ssh/sshd_config directly:

bash
# Set PasswordAuthentication no globally
sed -i 's/^#\?PasswordAuthentication .*/PasswordAuthentication no/' /etc/ssh/sshd_config

# Verify no subsequent Match blocks re-enable password logins
sshd -t && rc-service sshd restart
sshd -T | grep -i passwordauthentication

> [!CAUTION]

> The Locked Account Pitfall (`!` vs. `*`): Do not attempt to protect a passwordless account by replacing * with ! in /etc/shadow unless that account never requires SSH access. On musl builds compiled without PAM, OpenSSH treats an account locked with `!` as completely disabled, which simultaneously blocks public-key authentication for legitimate users!

---

Log Forensics: Did Anyone Break In?

Because sshole abuses standard authentication channels, a successful breach does not crash the daemon or generate core dumps. Instead, it registers in the system log as a completely normal, successful password login for an account that has no password.

Auditing System Logs for Breaches

Inspect local logs in /var/log/messages:

bash
# Search for all accepted password logins
grep 'sshd.*Accepted password for' /var/log/messages*

# Extract all accounts configured with '*' in /etc/shadow
awk -F: '$2=="*" {print $1}' /etc/shadow

# Inspect doas privilege escalation commands following suspicious sessions
grep doas /var/log/messages*

Indicators of Compromise (IoC)

  • High-Confidence Intrusion: Any log entry indicating Accepted password for targeting root, alpine, or any key-only user listed with * in /etc/shadow represents an unauthorized intrusion.
  • Secondary Reconnaissance: Inspect /etc/passwd, /etc/shadow, /var/log/wtmp, and ~/.ssh/authorized_keys for recently appended public keys or newly provisioned administrative users.
  • Containment Decision: If logs reveal a successful unauthorized password authentication, assume full host compromise. Disconnect the host from the network, preserve memory/disk state for forensic analysis, and rebuild from clean artifacts rather than attempting manual cleanup.

---

Under the Hood: Root Cause Analysis

The sshole vulnerability is an emergent failure arising from the intersection of three separate, well-intentioned architectural decisions:

text
┌────────────────────────────────────────────────────────────────────────┐
│                     THE THREE-FACTOR CONVERGENCE                       │
├────────────────────────────────────────────────────────────────────────┤
│ 1. 2012 musl crypt(): Implements 256-byte input cap on SHA-256/512.    │
│    Inputs >= 257 bytes fail and return the static string "*".          │
│                                                                        │
│ 2. 2016 OpenSSH Timing Leak Fix (CVE-2016-6210): When verifying an    │
│    unpassworded account ("*"), sshd computes a fake hash using a       │
│    borrowed salt from another account to equalize processing time.     │
│                                                                        │
│ 3. Non-PAM OpenSSH Verification: Directly executes                     │
│    strcmp(crypt(attempt, salt), shadow_pw).                            │
│                                                                        │
│ RESULT:                                                                │
│ crypt(password_257_bytes, borrowed_salt) -> returns "*"                │
│ strcmp("*", "*") == 0 -> PASSWORD ACCEPTED!                            │
└────────────────────────────────────────────────────────────────────────┘
  1. Non-PAM Authentication: Without PAM, OpenSSH invokes the standard C library function crypt(const char *key, const char *salt) directly, comparing the resulting string against the value in /etc/shadow.
  2. The CVE-2016-6210 Timing Defense: An account with * has no salt. To prevent attackers from enumerating usernames by measuring response latency, OpenSSH borrows the salt of an existing account (which is why a $5$ or $6$ account must exist) and passes the candidate password to crypt().
  3. musl's Error Handling Convention: In 2012, musl libc capped passwords for SHA-256 ($5$) and SHA-512 ($6$) at 256 bytes. When crypt() receives an input exceeding 256 bytes, it aborts computation and returns the literal error string *.

When an attacker supplies a password of 257 characters or longer against a passwordless user, musl's crypt() fails and returns *. OpenSSH compares this return value (*) with the account's password field in /etc/shadow (*). The strings match, and OpenSSH grants shell access.

The Fix in OpenSSH 10.6p2

OpenSSH 10.6p2 remediates the flaw by validating the length of the stored password hash before performing the comparison. If the target account's hash in /etc/shadow is too short to represent a valid cryptographic hash (as * is), OpenSSH rejects the login attempt immediately, regardless of what crypt() returns.

The vulnerability was discovered by security researcher Özgün Kültekin of Wakefield, who uncovered the behavior by fuzzing approximately 17,600 non-standard authentication sequences across varied combinations of C libraries, PAM configurations, and compiler flags using autonomous agent swarms.

---

Discrepancies Across Public Advisories

text
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                 ADVISORY COMPARISON & CLARIFICATIONS                                    │
├────────────────────┬───────────────────────────────────────┬────────────────────────────────────────────┤
│ TOPIC              │ REPORTED STATEMENTS                   │ TECHNICAL RESOLUTION                       │
├────────────────────┼───────────────────────────────────────┼────────────────────────────────────────────┤
│ CVE Designation    │ Alpine initially reported no CVE ID;  │ MITRE published CVE-2026-123158 on Nov 5.  │
│                    │ MITRE published later that day.       │ Use CVE-2026-123158 in all trackers.       │
├────────────────────┼───────────────────────────────────────┼────────────────────────────────────────────┤
│ Minimum Length     │ Alpine: 257-1024 bytes;               │ musl's hard buffer cap is 256 bytes.       │
│                    │ Finder: > 256 bytes; CVE: 256-1024.   │ The bypass initiates at exactly 257 bytes. │
├────────────────────┼───────────────────────────────────────┼────────────────────────────────────────────┤
│ Exploitation State │ Alpine (Nov 5): No known attacks.     │ Previdian confirmed active honeypot attacks│
│                    │ Previdian (Nov 6): Active honeypot hit│ within 9 hours. Treat as actively targeted.│
├────────────────────┼───────────────────────────────────────┼────────────────────────────────────────────┤
│ Root Responsibility│ OpenSSH: Fault lies in musl crypt().  │ Pragmatically irrelevant for operators;    │
│                    │ musl: Fault lies in OpenSSH caller.   │ the actionable patch resides in OpenSSH.   │
├────────────────────┼───────────────────────────────────────┼────────────────────────────────────────────┤
│ CVSS Severity      │ MITRE CVSS 3.1: 8.1 (High);           │ Four strict preconditions lower general    │
│                    │ OpenSSH Advisory: Critical.           │ score, but exploitability is 100% on targets│
└────────────────────┴───────────────────────────────────────┴────────────────────────────────────────────┘

---

Actionable Defense Checklist

  1. Inventory All musl Deployments: Scan for Alpine Linux virtual machines, bare-metal servers, embedded appliances, and any container images that explicitly install openssh-server.
  2. Execute `sshole-audit.sh`: Run the audit script as root across candidate hosts. Prioritize any instance returning exit code 1.
  3. Apply Upgrades and Explicitly Restart Services: Execute apk upgrade -U -a and confirm service restart via rc-service sshd restart.
  4. Enforce Global Password Prohibition: Where patching cannot occur immediately, deploy PasswordAuthentication no inside /etc/ssh/sshd_config.d/00-no-passwords.conf.
  5. Inspect Historical System Logs: Grep /var/log/messages* for successful password logins targeting unpassworded accounts (root, alpine).
  6. Remediate Cloud Instances in Place: Update active tiny-cloud instances immediately; do not rely on base image updates to protect running workloads.
  7. Adopt Universal Public-Key Authentication: Permanently disable password authentication across all SSH servers. Key-based authentication renders this vulnerability entirely inert.

---

Frequently Asked Questions (FAQ)

Are standard Alpine Docker containers vulnerable?

Only if the container actively runs sshd. Most application containers run single microservices (e.g., Nginx, Node.js, Go binaries) without an SSH server and are completely unaffected. Containers operating as bastion hosts, remote development environments, or CI workers that install openssh-server are vulnerable.

Are Debian, Ubuntu, or Red Hat Enterprise Linux (RHEL) vulnerable?

No. Systems using the GNU C Library (glibc) fail differently when encountering oversized inputs and do not return *. Furthermore, enterprise Linux distributions authenticate SSH through PAM by default, which bypasses the vulnerable code path entirely.

Can threat actors log directly into the root account?

Not under a standard OpenSSH deployment. OpenSSH defaults to PermitRootLogin prohibit-password, which blocks password logins for root regardless of password length. Attackers target secondary passwordless accounts (such as alpine on cloud images) and escalate to root via doas or sudo.

I ran `apk upgrade` on my Alpine host. Am I protected?

No, not until you restart the SSH daemon. Upgrading replaces the binary files on the disk, but the active process listening on port 22 remains in memory executing the unpatched code. You must run rc-service sshd restart to load the patched binary.

---

Verification Test Methodology & Sources

What Was Tested

  • Script Validation: The sshole-audit.sh script was tested against six fixture setups simulating:

1. A vulnerable musl host meeting all four conditions. 2. A glibc-based host. 3. A PAM-enabled host (UsePAM yes). 4. A host with PasswordAuthentication no. 5. A host with zero $5$ or $6$ password hashes. 6. A host containing only locked accounts (!). The audit script returned the expected exit codes (1 or 0) across all test configurations and passed sh -n syntax validation.

What Was Not Tested

  • Live exploitation was not executed against production hosts.
  • Third-party public exploit scripts circulating on GitHub were not run to prevent security risks associated with unvetted proof-of-concept malware.

Primary References & Authoritative Sources