high

CVE

CVE-2026-123158, CVE-2026-107891, CVE-2016-6210, CVE-2019-5021

CWE

CWE-287, CWE-303, CWE-252, CWE-697, CWE-190, CWE-787

Affected Surface

  • Portable OpenSSH (`sshd`) `7.3p1` through `10.6p1` (`< 10.6p2`) on Linux with `musl` libc and PAM disabled (`UsePAM no` or built without `--with-pam`), fixed in `10.6p2` (commit `4353fdc43ef6`) (`CVE-2026-123158`)
  • Alpine Linux `openssh-server` before `10.6_p2-r0` (`edge`), `10.3_p1-r2` (`3.24`), `10.2_p1-r1` (`3.23`), `10.0_p1-r11` (`3.22`), `9.9_p2-r1` (`3.21`), `9.7_p1-r6` (`3.20`), `9.6_p1-r3` (`3.19`), `9.3_p2-r4` (`3.18`), `9.1_p1-r7` (`3.17`), and `9.0_p1-r6` (`3.16`)
  • Official Alpine Linux AWS and Azure cloud images, `tiny-cloud` images, Alpine-based Docker/OCI containers running `sshd`, and `musl` builds of OpenWrt (with `openssh-server` instead of Dropbear), Buildroot, and Yocto (`TCLIBC=musl`) where `PasswordAuthentication yes` is active, a permitted account has `*` in `/etc/shadow`, and another local account has a `$5$` or `$6$` password hash
  • `musl` libc `0.5.0` through `1.2.6` (`< 1.2.7`) when compiling untrusted regular expressions with `regcomp()` (`CVE-2026-107891`)

TL;DR

On 5 November 2026, the OpenSSH team shipped Portable OpenSSH 10.6p2 to fix CVE-2026-123158 (CVSS v3.1 8.1 High, EPSS 0.98% / 62.3rd percentile). Alpine Linux shipped patched openssh packages for every branch from 3.16 through 3.24 and edge the same day. The bug is an unauthenticated password authentication bypass found by Özgün Kültekin of Wakefield and disclosed as *sshole. Public reproduction labs and multiple working proofs of concept were available on disclosure day.

The bug affects Linux systems that link OpenSSH against musl libc and run sshd without PAM. That is the default openssh-server build on Alpine Linux, and it also covers OpenWrt (with openssh-server), Buildroot, and Yocto (TCLIBC=musl) builds. On these systems, an attacker can log into an account whose /etc/shadow password field is * (password login disabled) by sending any password between 257 and 1,024 bytes long.

Less than nine hours after the CVE was published, threat intelligence firm Previdian recorded exploitation attempts from 89.116.89[.]18. The attacker got unauthenticated root access on an Alpine Linux OpenSSH honeypot and ran id, uname, and hostname over non-interactive SSH sessions.

The same day, NVD also published CVE-2026-107891 (CVSS 8.1 High). It covers integer overflows in musl’s regcomp() that lead to out-of-bounds heap writes. It is fixed in musl 1.2.7.

All five conditions below must hold for a host to be vulnerable to CVE-2026-123158:

  1. sshd runs on Linux against musl libc (Alpine Linux, OpenWrt, Buildroot, Yocto). Distributions that use glibc or libxcrypt (Debian, Ubuntu, RHEL, Fedora, SUSE, Arch) and non-Linux systems (OpenBSD) are not affected.

  2. PAM is disabled: openssh-server built without PAM, or openssh-server-pam with UsePAM no.

  3. PasswordAuthentication yes is set. This is the OpenSSH default.

  4. The target account has * as its password hash in /etc/shadow, and sshd policy lets that account log in. Examples:

    • root, which ships as root:* since Alpine 3.16. One source notes that a password login as root also needs PermitRootLogin yes.
    • The default alpine user on official Alpine AWS and Azure cloud images (with passwordless doas) and in tiny-cloud images.
    • SSH-key-only users created with adduser or usermod -p '*', and deploy accounts.
    • LDAP/directory accounts served through musl-nscd.

    Accounts locked with ! or !* are not affected.

  5. At least one other local account has a $5$ (SHA-256) or $6$ (SHA-512) password hash in /etc/shadow. pick_salt() borrows this salt when it hashes a password for the * account. One source describes this condition more broadly as any $-prefixed hash.

What to do now:

  1. Upgrade openssh and restart sshd. On Alpine, run apk upgrade openssh && rc-service sshd restart (or apk upgrade -U -a). Upgrading the package does not restart a running sshd. The old, vulnerable binary keeps accepting connections until you restart it.
  2. Upgrade musl to 1.2.7 for CVE-2026-107891 (apk upgrade openssh musl on Alpine). Rebuild container images that start from alpine and install openssh-server.
  3. If you cannot upgrade right away, set PasswordAuthentication no in /etc/ssh/sshd_config (or in /etc/ssh/sshd_config.d/00-no-passwords.conf) and restart sshd.
  4. Audit /var/log/messages and /var/log/auth.log for any Accepted password for <user> entry where <user> has * in /etc/shadow (root, alpine, or key-only deploy users).

Affected packages and branches

All OpenSSH and Alpine fixes below were released on 5 November 2026.

Component / BranchCVEPackageVulnerable versionsFixed versionNotes
Portable OpenSSH (upstream)CVE-2026-123158openssh-portable (sshd)7.3p1 through 10.6p1 (< 10.6p2, since July 2016)10.6p2 (commit 4353fdc43ef6)Vulnerable on Linux with musl libc when built or run without PAM
Alpine Linux edgeCVE-2026-123158openssh / openssh-server< 10.6_p2-r010.6_p2-r0Default openssh-server builds without PAM
Alpine Linux 3.24CVE-2026-123158openssh / openssh-server< 10.3_p1-r210.3_p1-r2Ships in Alpine 3.24.4
Alpine Linux 3.23 / 3.22CVE-2026-123158openssh / openssh-server< 10.2_p1-r1 (3.23), < 10.0_p1-r11 (3.22)10.2_p1-r1, 10.0_p1-r11Ship in Alpine 3.23.8 and 3.22.8; backported MIN_PASSWORD_HASH_LEN check
Alpine Linux 3.21CVE-2026-123158openssh / openssh-server< 9.9_p2-r19.9_p2-r1Ships in Alpine 3.21.10; 3.21 reached EOL on 1 Nov 2026
Alpine Linux 3.20 / 3.19CVE-2026-123158openssh / openssh-server< 9.7_p1-r6 (3.20), < 9.6_p1-r3 (3.19)9.7_p1-r6, 9.6_p1-r3EOL branches; emergency backports
Alpine Linux 3.18 / 3.17 / 3.16CVE-2026-123158openssh / openssh-server< 9.3_p2-r4 (3.18), < 9.1_p1-r7 (3.17), < 9.0_p1-r6 (3.16)9.3_p2-r4, 9.1_p1-r7, 9.0_p1-r6EOL branches; Alpine 3.16 switched root in /etc/shadow from ! to *
OpenWrt / Buildroot / Yocto (TCLIBC=musl)CVE-2026-123158openssh-server< 10.6p2 (built without PAM)10.6p2Default OpenWrt uses Dropbear and is not affected. Only installs that added openssh-server are.
musl libc (src/regex/regcomp.c)CVE-2026-107891musl0.5.0 through 1.2.61.2.7 (commit 7813e9119eb5)Applications that pass untrusted regular expressions to regcomp()

One source listed the affected Alpine range as 3.16 through 3.23 and edge. The Alpine advisory and the other two sources include 3.24, so 3.24 is listed here.

Technical analysis

1. Four pieces that collide on the character "*"

The *sshole disclosure describes the bug as an interaction between Unix /etc/shadow conventions, Alpine’s account defaults, musl libc’s crypt(3), and OpenSSH’s non-PAM password check. The predkambrij/sshhole-repro and leonjza/sshhole-lab labs reproduce it.

  1. The Unix * convention (3BSD, 1980) and Alpine’s switch to it (2022). A * in the password field means no password login is allowed. No valid crypt(3) output is 1 character long, so strcmp(crypt(input, salt), "*") was assumed never to match. ! works differently. Without PAM, OpenSSH’s allowed_user() treats ! as a locked account and blocks SSH public-key logins too, unless locked_account_may_login is satisfied. * disables password login but still allows key login. So in May 2022, Alpine 3.16 (commit fbe926af) changed root, and key-only cloud accounts such as alpine, from ! to * so SSH key authentication would work out of the box.

  2. musl crypt(3) returns "*" on failure and caps SHA-crypt input at 256 bytes (August 2012). Many C programs call strcmp(crypt(pw, salt), hash) without checking for NULL. To keep them from crashing, musl commit b3c4cc12 (9 August 2012) made crypt() return the static string "*" whenever hashing fails. One source adds that it returns "x" instead if the salt itself starts with '*'. Twenty days later, commit 88bf5a8a (29 August 2012) added crypt_sha512.c ($6$) and crypt_sha256.c ($5$) with a hard limit of #define KEY_MAX 256, to prevent CPU denial of service from huge passwords:

// src/crypt/crypt_sha512.c in musl libc
#define KEY_MAX 256

static char *sha512crypt(const char *key, const char *setting, char *output)
{
	// ...
	klen = strnlen(key, KEY_MAX+1);
	if (klen > KEY_MAX) return 0;

Two sources show the same check in shorter form as if (strlen(key) > KEY_MAX) return 0;.

When sha512crypt() returns 0 (NULL) for a password longer than 256 bytes, musl’s outer crypt_r() wrapper returns "*". The excerpt below is abbreviated. In the real code, crypt_sha512.c returns 0 to __crypt_r, and __crypt_r (in crypt_r.c / crypt.c) turns that error into "*":

// src/crypt/crypt_r.c in musl libc
char *__crypt_r(const char *key, const char *salt, struct crypt_data *data)
{
	// ...
	if (salt[0] == '$' && salt[1] && salt[2]) {
		if (salt[1] == '5' && salt[2] == '$')
			return __crypt_sha256(key, salt, output);
		if (salt[1] == '6' && salt[2] == '$')
			return __crypt_sha512(key, salt, output);
	}
	return "*";
}
  1. OpenSSH’s CVE-2016-6210 timing fix borrows a real salt (pick_salt(), July 2016). If sshd passed "*" straight to crypt(password, "*"), musl would not return "*". The sources describe this two ways. One says __crypt_r sees that salt[0] is not '$' and runs traditional DES crypt, which reads only the first 8 bytes of the password and produces a 13-character hash. Another says musl returns "x" because the salt starts with '*'. Either way, the result never equals "*".

    The trigger is a change from July 2016. To fix CVE-2016-6210, a timing side channel that let attackers tell accounts with valid $6$ hashes apart from invalid or passwordless ones, OpenSSH 7.3p1 changed xcrypt() in openbsd-compat/xcrypt.c. When the stored pw_password does not start with '$', which is true for "*", xcrypt() calls pick_salt(). pick_salt() scans the password database with getpwent(), finds the first local user with a real $...$ hash (for example alice:$6$salt$... or $6$rounds=...$salt$), and caches that salt prefix in a static salt[32] buffer. Password hashing then takes the same CPU time as for a real user:

// openbsd-compat/xcrypt.c in openssh-portable prior to 10.6p2
static const char *
pick_salt(void)
{
	struct passwd *pw;
	char *passwd, *p;
	size_t typelen;
	static char salt[32];

	if (salt[0] != '\0')
		return salt;
	strlcpy(salt, "xx", sizeof(salt));
	setpwent();
	while ((pw = getpwent()) != NULL) {
		if ((passwd = shadow_pw(pw)) == NULL)
			continue;
		if (passwd[0] == '$' && (p = strrchr(passwd+1, '$')) != NULL) {
			typelen = p - passwd + 1;
			strlcpy(salt, passwd, MINIMUM(typelen, sizeof(salt)));
			explicit_bzero(passwd, strlen(passwd));
			goto out;
		}
	}
 out:
	endpwent();
	return salt;
}

char *
xcrypt(const char *password, const char *salt)
{
	char *crypted;

	/*
	 * If we don't have a $ type salt closely resembling the real one then
	 * pick one from the password database so the timing is equivalent.
	 */
	if (salt[0] != '$')
		salt = pick_salt();
  1. sys_auth_passwd() compares "*" with "*". In auth-passwd.c, the check before 10.6p2 was:
return encrypted_password != NULL &&
    strcmp(encrypted_password, pw_password) == 0;

2. How the 257-byte password bypass runs

Take an attacker who connects to sshd as root (root:*:... in /etc/shadow) on an Alpine host where some other local user has a $6$... hash. MAX_PASSWORD_LEN in auth-passwd.c is 1024.

  1. In sys_auth_passwd(), pw_password is read from /etc/shadow and equals "*".
  2. salt is set to pw_password ("*") and passed to xcrypt(password, "*").
  3. Because salt[0] != '$', xcrypt() calls pick_salt(). It finds the other user’s $6$<salt>$ prefix and calls crypt(password, "$6$<salt>$").
  4. The password is between 257 and 1,024 bytes. musl dispatches to sha512crypt(), which sees klen > 256 (KEY_MAX) and fails. Because the borrowed salt starts with '$', not '*', crypt() returns "*".
  5. Back in sys_auth_passwd(), encrypted_password is "*" and pw_password is "*". strcmp("*", "*") == 0 is true, so sshd logs Accepted password for root and opens a root session.

How many attempts it takes. The sources disagree here. One source says sshd grants the login on the first attempt. Another says the exploit sends two password attempts in one SSH connection. In that account, the getpwent() loop in pick_salt() overwrites the static getpwnam buffer during the first attempt, so the first attempt only fills the cached static salt[32] buffer. The second attempt, 257 to 1024 bytes long, calls crypt(password_257_bytes, "$6$..."), fails the KEY_MAX check, and gets "*". The same source advises looking for an Accepted password that follows a single Failed password on the same connection.

3. The OpenSSH 10.6p2 fix (4353fdc43ef6)

Damien Miller’s commit 4353fdc43ef646c43a8dda7025cc1a898caf1482 makes two changes in auth-passwd.c:

  • It defines #define MIN_PASSWORD_HASH_LEN 4 and rejects any stored hash shorter than 4 bytes before comparing.
  • It fixes a static buffer lifetime problem. shadow_pw() used to return a pointer into getspnam()’s static buffer, which pick_salt()’s getpwent() scan could overwrite and then zero with explicit_bzero(). Now sys_auth_passwd() works on a heap copy (xstrdup()) that is wiped with freezero() after use.
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -67,6 +68,7 @@ extern login_cap_t *lc;
 #define DAY		(24L * 60 * 60) /* 1 day in seconds */
 #define TWO_WEEKS	(2L * 7 * DAY)	/* 2 weeks in seconds */
 
+#define MIN_PASSWORD_HASH_LEN	4
 #define MAX_PASSWORD_LEN	1024
 
 /*
@@ -198,16 +200,20 @@ sys_auth_passwd(struct ssh *ssh, const char *password)
 	Authctxt *authctxt = ssh->authctxt;
 	struct passwd *pw = authctxt->pw;
 	char *encrypted_password, *salt = NULL;
+	int ret;
 
 	/* Just use the supplied fake password if authctxt is invalid */
-	char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd;
+	char *pw_password = authctxt->valid ?
+	    shadow_pw(pw) : xstrdup(pw->pw_passwd);
 
 	if (pw_password == NULL)
 		return 0;
@@ -221,7 +227,10 @@ sys_auth_passwd(struct ssh *ssh, const char *password)
 	 * Authentication is accepted if the encrypted passwords
 	 * are identical.
 	 */
-	return encrypted_password != NULL &&
+	ret = encrypted_password != NULL &&
+	    strlen(pw_password) >= MIN_PASSWORD_HASH_LEN &&
 	    strcmp(encrypted_password, pw_password) == 0;
+	freezero(pw_password, strlen(pw_password));
+	return ret;
 }

Alpine backported the same MIN_PASSWORD_HASH_LEN check to its older branches.

4. CVE-2026-107891: musl regcomp() integer overflows lead to heap writes out of bounds

Julien Voisin reported this bug. Szabolcs Nagy and Rich Felker analyzed it (musl list, 2026/10/21/1). In musl 0.5.0 through 1.2.6, the TRE-derived regular expression compiler in src/regex/regcomp.c did unchecked 32-bit signed int arithmetic. Short Extended Regular Expressions (EREs) with nested interval repetitions, such as (((a{255}){255}){255}){255} or ((a|b*){255,}){255,}, or with large alternation branches, overflow position, num_tags, or num_transitions during AST expansion (tre_expand_ast). xmalloc then allocates a buffer that is too small, and the compiler writes NFA transition tables past the end of the heap chunk.

Commit 7813e9119eb5fe681b6750b8a033a0490bca0941, shipping in musl 1.2.7, does three things:

  • It caps the input regex length.
  • It adds a checked-addition helper, check_add(), for the tag and transition counters.
  • It replaces xmalloc(sizeof(...) * n) with xcalloc(n, sizeof(...)).

IOCs and in-the-wild telemetry

Previdian reported the first exploitation attempts less than nine hours after CVE-2026-123158 was published. It captured eight attempts against an Alpine Linux + OpenSSH honeypot, and they resulted in root access.

IndicatorValueContext
Attacker source IPv4 (defanged)89.116.89[.]18Geolocated to Japan. Sent passwords of 257+ bytes to log in as root, then ran id, uname, and hostname over non-interactive SSH sessions.
Host log line (/var/log/messages or /var/log/auth.log)Accepted password for <user> from <ip> port <port> ssh2<user> (root, alpine, or any key-only user) has * in /etc/shadow
Log sequenceOne Failed password followed by Accepted password for the same accountSame connection or sshd PID (see the two-attempt account above)

Detection and remediation

1. Check whether a host or container image meets the vulnerable conditions

Run this on Linux hosts and inside container images. It checks for musl libc, the installed OpenSSH version and active sshd settings, * accounts next to $5$/$6$ donor accounts, past password logins to * accounts, and Dockerfiles that install openssh-server:

# 1. Check libc, installed OpenSSH version, and active sshd configuration
ldd "$(command -v sshd)" 2>/dev/null | grep -i 'musl\|pam' || true
sshd -V 2>&1 | head -n 2
apk info -v openssh-server 2>/dev/null || ssh -V
sshd -T 2>/dev/null | grep -E '^(usepam|passwordauthentication|permitrootlogin|allowusers|allowgroups)\b'

# 2. List accounts with '*' and accounts with '$5$'/'$6$' hashes (salt donors) in /etc/shadow
sudo awk -F: '$2 == "*" { print "STAR_ACCOUNT:", $1 } $2 ~ /^\$[56]\$/ { print "HASH_ACCOUNT:", $1 }' /etc/shadow

# 3. Hunt /var/log/messages and /var/log/auth* for password logins to '*' accounts
for acct in $(sudo awk -F: '$2 == "*" { print $1 }' /etc/shadow); do
  grep -Hn "Accepted password for ${acct} " /var/log/messages* /var/log/auth* 2>/dev/null || true
done

# 4. Find Dockerfiles and compose files that install openssh-server
rg -n 'openssh(-server)?' Dockerfile* docker-compose*.yml 2>/dev/null

A host is exploitable only if every condition is met. Step 1 must show musl and no PAM, with passwordauthentication yes. Step 2 must show at least one * account that sshd_config allows to log in (check permitrootlogin, allowusers, and allowgroups) and at least one $5$/$6$ account.

If step 3 shows any Accepted password for <acct> line for an account whose /etc/shadow entry is *, treat the machine as compromised:

  1. Isolate the host.
  2. Inspect /root/.ssh/authorized_keys, /home/*/.ssh/authorized_keys, /etc/passwd, /etc/shadow, and the doas and cron logs.
  3. Rebuild the instance or container from a clean image.
  4. Rotate every SSH key, cloud credential, and application secret that was on the host.

2. Upgrade openssh and musl, then restart sshd

On Alpine Linux (3.16 through 3.24 and edge):

# Upgrade openssh (and musl for CVE-2026-107891), then restart the running sshd
apk update && apk upgrade openssh musl
rc-service sshd restart

# Or upgrade all packages, then restart sshd
sudo apk upgrade -U -a
sudo rc-service sshd restart

On other systems, install OpenSSH 10.6p2 or a distribution openssh-server package that includes commit 4353fdc43ef6, and musl 1.2.7 or a package that includes commit 7813e9119eb5. Rebuild any container images derived from alpine that install openssh-server.

3. If you cannot upgrade yet

Turn off password authentication and restart sshd:

mkdir -p /etc/ssh/sshd_config.d
echo "PasswordAuthentication no" > /etc/ssh/sshd_config.d/00-no-passwords.conf
sshd -t && rc-service sshd restart

You can also set PasswordAuthentication no directly in /etc/ssh/sshd_config. To restart, use rc-service sshd restart or kill -HUP $(cat /run/sshd.pid).

Other options from the sources:

  • Set PermitRootLogin prohibit-password to block password logins as root.
  • Change the * shadow field on accounts that do not need key-only * behavior. Use *NP*, which is 4 characters and can never equal crypt()’s 1-character "*". Or use ! or !!. OpenSSH treats an account whose field starts with ! as locked, so it cannot log in even on an unpatched daemon. Without PAM, that also blocks SSH key login for the account.

Timeline

  • 1980 (3BSD): * in the password field becomes the Unix convention for “no password login”.
  • 2012-08-09: musl commit b3c4cc12 makes crypt() return "*" on failure.
  • 2012-08-29: musl commit 88bf5a8a adds crypt_sha256.c and crypt_sha512.c with the KEY_MAX 256 limit.
  • July 2016: OpenSSH adds pick_salt() in openbsd-compat/xcrypt.c to mitigate the CVE-2016-6210 user-enumeration timing attack. One source dates the commit to 2016-07-18. Another dates the change to the OpenSSH 7.3p1 release on 2016-07-21.
  • May 2022: Alpine Linux 3.16 (commit fbe926af) changes the default root entry in /etc/shadow from ! to *.
  • 2026-10-21: Rich Felker publishes the CVE-2026-107891 advisory and patch (7813e9119eb5) for musl regcomp().
  • 2026-11-01: Alpine 3.21 reaches end of life.
  • 2026-11-04, 21:18 UTC: Damien Miller commits 4353fdc43ef646c43a8dda7025cc1a898caf1482 (MIN_PASSWORD_HASH_LEN 4) to openssh-portable after Özgün Kültekin’s report. One source gives the commit window as 21:18 to 21:57 UTC.
  • 2026-11-05, 09:01 UTC: Portable OpenSSH 10.6p2 is released. Alpine Linux publishes patched openssh packages for edge and 3.16 through 3.24. Özgün Kültekin publishes technical details at sshhole.com. The leonjza/sshhole-lab and predkambrij/sshhole-repro reproduction labs go live the same day.
  • 2026-11-05, 16:17 UTC: NVD publishes CVE-2026-123158 (CVSS 8.1 High) and CVE-2026-107891 (CVSS 8.1 High). One source describes CVE-2026-123158 as assigned between 5 and 6 November.
  • 2026-11-06: Previdian reports exploitation from 89.116.89[.]18, starting less than nine hours after CVE publication, with root compromise of an Alpine Linux honeypot. StepSecurity publishes a lab reproduction and container/CI remediation analysis.

From research to remediation

Check whether this pattern exists in your codebase

Turn this research into a remediation workflow. Use AI-native static analysis to find similar application vulnerabilities and generate review-ready fixes.

References