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:
-
sshdruns on Linux againstmusllibc (Alpine Linux, OpenWrt, Buildroot, Yocto). Distributions that useglibcorlibxcrypt(Debian, Ubuntu, RHEL, Fedora, SUSE, Arch) and non-Linux systems (OpenBSD) are not affected. -
PAM is disabled:
openssh-serverbuilt without PAM, oropenssh-server-pamwithUsePAM no. -
PasswordAuthentication yesis set. This is the OpenSSH default. -
The target account has
*as its password hash in/etc/shadow, andsshdpolicy lets that account log in. Examples:root, which ships asroot:*since Alpine3.16. One source notes that a password login asrootalso needsPermitRootLogin yes.- The default
alpineuser on official Alpine AWS and Azure cloud images (with passwordlessdoas) and intiny-cloudimages. - SSH-key-only users created with
adduserorusermod -p '*', and deploy accounts. - LDAP/directory accounts served through
musl-nscd.
Accounts locked with
!or!*are not affected. -
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:
- Upgrade
opensshand restartsshd. On Alpine, runapk upgrade openssh && rc-service sshd restart(orapk upgrade -U -a). Upgrading the package does not restart a runningsshd. The old, vulnerable binary keeps accepting connections until you restart it. - Upgrade
muslto1.2.7forCVE-2026-107891(apk upgrade openssh muslon Alpine). Rebuild container images that start fromalpineand installopenssh-server. - If you cannot upgrade right away, set
PasswordAuthentication noin/etc/ssh/sshd_config(or in/etc/ssh/sshd_config.d/00-no-passwords.conf) and restartsshd. - Audit
/var/log/messagesand/var/log/auth.logfor anyAccepted 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 / Branch | CVE | Package | Vulnerable versions | Fixed version | Notes |
|---|---|---|---|---|---|
| Portable OpenSSH (upstream) | CVE-2026-123158 | openssh-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 edge | CVE-2026-123158 | openssh / openssh-server | < 10.6_p2-r0 | 10.6_p2-r0 | Default openssh-server builds without PAM |
Alpine Linux 3.24 | CVE-2026-123158 | openssh / openssh-server | < 10.3_p1-r2 | 10.3_p1-r2 | Ships in Alpine 3.24.4 |
Alpine Linux 3.23 / 3.22 | CVE-2026-123158 | openssh / openssh-server | < 10.2_p1-r1 (3.23), < 10.0_p1-r11 (3.22) | 10.2_p1-r1, 10.0_p1-r11 | Ship in Alpine 3.23.8 and 3.22.8; backported MIN_PASSWORD_HASH_LEN check |
Alpine Linux 3.21 | CVE-2026-123158 | openssh / openssh-server | < 9.9_p2-r1 | 9.9_p2-r1 | Ships in Alpine 3.21.10; 3.21 reached EOL on 1 Nov 2026 |
Alpine Linux 3.20 / 3.19 | CVE-2026-123158 | openssh / openssh-server | < 9.7_p1-r6 (3.20), < 9.6_p1-r3 (3.19) | 9.7_p1-r6, 9.6_p1-r3 | EOL branches; emergency backports |
Alpine Linux 3.18 / 3.17 / 3.16 | CVE-2026-123158 | openssh / 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-r6 | EOL branches; Alpine 3.16 switched root in /etc/shadow from ! to * |
OpenWrt / Buildroot / Yocto (TCLIBC=musl) | CVE-2026-123158 | openssh-server | < 10.6p2 (built without PAM) | 10.6p2 | Default OpenWrt uses Dropbear and is not affected. Only installs that added openssh-server are. |
musl libc (src/regex/regcomp.c) | CVE-2026-107891 | musl | 0.5.0 through 1.2.6 | 1.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.
-
The Unix
*convention (3BSD, 1980) and Alpine’s switch to it (2022). A*in the password field means no password login is allowed. No validcrypt(3)output is 1 character long, sostrcmp(crypt(input, salt), "*")was assumed never to match.!works differently. Without PAM, OpenSSH’sallowed_user()treats!as a locked account and blocks SSH public-key logins too, unlesslocked_account_may_loginis satisfied.*disables password login but still allows key login. So in May 2022, Alpine3.16(commitfbe926af) changedroot, and key-only cloud accounts such asalpine, from!to*so SSH key authentication would work out of the box. -
muslcrypt(3)returns"*"on failure and caps SHA-crypt input at 256 bytes (August 2012). Many C programs callstrcmp(crypt(pw, salt), hash)without checking forNULL. To keep them from crashing,muslcommitb3c4cc12(9 August 2012) madecrypt()return the static string"*"whenever hashing fails. One source adds that it returns"x"instead if the salt itself starts with'*'. Twenty days later, commit88bf5a8a(29 August 2012) addedcrypt_sha512.c($6$) andcrypt_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 "*";
}
-
OpenSSH’s
CVE-2016-6210timing fix borrows a real salt (pick_salt(), July 2016). Ifsshdpassed"*"straight tocrypt(password, "*"),muslwould not return"*". The sources describe this two ways. One says__crypt_rsees thatsalt[0]is not'$'and runs traditional DEScrypt, which reads only the first 8 bytes of the password and produces a 13-character hash. Another saysmuslreturns"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, OpenSSH7.3p1changedxcrypt()inopenbsd-compat/xcrypt.c. When the storedpw_passworddoes not start with'$', which is true for"*",xcrypt()callspick_salt().pick_salt()scans the password database withgetpwent(), finds the first local user with a real$...$hash (for examplealice:$6$salt$...or$6$rounds=...$salt$), and caches that salt prefix in a staticsalt[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();
sys_auth_passwd()compares"*"with"*". Inauth-passwd.c, the check before10.6p2was:
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.
- In
sys_auth_passwd(),pw_passwordis read from/etc/shadowand equals"*". saltis set topw_password("*") and passed toxcrypt(password, "*").- Because
salt[0] != '$',xcrypt()callspick_salt(). It finds the other user’s$6$<salt>$prefix and callscrypt(password, "$6$<salt>$"). - The password is between
257and1,024bytes.musldispatches tosha512crypt(), which seesklen > 256(KEY_MAX) and fails. Because the borrowed salt starts with'$', not'*',crypt()returns"*". - Back in
sys_auth_passwd(),encrypted_passwordis"*"andpw_passwordis"*".strcmp("*", "*") == 0is true, sosshdlogsAccepted password for rootand 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 4and rejects any stored hash shorter than 4 bytes before comparing. - It fixes a static buffer lifetime problem.
shadow_pw()used to return a pointer intogetspnam()’s static buffer, whichpick_salt()’sgetpwent()scan could overwrite and then zero withexplicit_bzero(). Nowsys_auth_passwd()works on a heap copy (xstrdup()) that is wiped withfreezero()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)withxcalloc(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.
| Indicator | Value | Context |
|---|---|---|
| Attacker source IPv4 (defanged) | 89.116.89[.]18 | Geolocated 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 sequence | One Failed password followed by Accepted password for the same account | Same 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:
- Isolate the host.
- Inspect
/root/.ssh/authorized_keys,/home/*/.ssh/authorized_keys,/etc/passwd,/etc/shadow, and thedoasand cron logs. - Rebuild the instance or container from a clean image.
- 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-passwordto block password logins asroot. - Change the
*shadow field on accounts that do not need key-only*behavior. Use*NP*, which is 4 characters and can never equalcrypt()’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:
muslcommitb3c4cc12makescrypt()return"*"on failure. - 2012-08-29:
muslcommit88bf5a8aaddscrypt_sha256.candcrypt_sha512.cwith theKEY_MAX 256limit. - July 2016: OpenSSH adds
pick_salt()inopenbsd-compat/xcrypt.cto mitigate theCVE-2016-6210user-enumeration timing attack. One source dates the commit to 2016-07-18. Another dates the change to the OpenSSH7.3p1release on 2016-07-21. - May 2022: Alpine Linux
3.16(commitfbe926af) changes the defaultrootentry in/etc/shadowfrom!to*. - 2026-10-21: Rich Felker publishes the
CVE-2026-107891advisory and patch (7813e9119eb5) formuslregcomp(). - 2026-11-01: Alpine
3.21reaches end of life. - 2026-11-04, 21:18 UTC: Damien Miller commits
4353fdc43ef646c43a8dda7025cc1a898caf1482(MIN_PASSWORD_HASH_LEN 4) toopenssh-portableafter Özgün Kültekin’s report. One source gives the commit window as21:18to21:57 UTC. - 2026-11-05, 09:01 UTC: Portable OpenSSH
10.6p2is released. Alpine Linux publishes patchedopensshpackages foredgeand3.16through3.24. Özgün Kültekin publishes technical details atsshhole.com. Theleonjza/sshhole-labandpredkambrij/sshhole-reproreproduction labs go live the same day. - 2026-11-05, 16:17 UTC: NVD publishes
CVE-2026-123158(CVSS 8.1 High) andCVE-2026-107891(CVSS 8.1 High). One source describesCVE-2026-123158as 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
- OpenSSH 10.6p2 Release Notes (5 November 2026)
- openssh-portable commit 4353fdc43ef646c43a8dda7025cc1a898caf1482 (Damien Miller: avoid password authn bypass)
- Özgün Kültekin (Wakefield): *sshole, OpenSSH on musl Linux password-less account bypass (sshhole.com)
- oss-security announcement (5 November 2026): Portable OpenSSH 10.6p2 released and 'sshole' password authentication bypass
- Alpine Linux Security Advisory (5 November 2026): openssh-server password authentication bypass
- Alpine aports commit fbe926af (root shadow entry changed from ! to *)
- NVD: CVE-2026-123158 Detail
- Help Net Security / Previdian telemetry (6 November 2026): OpenSSH flaw exploited in the wild just hours after disclosure (CVE-2026-123158)
- StepSecurity (6 November 2026): CVE-2026-123158 (*sshole): OpenSSH Password Authentication Bypass on Alpine Linux
- Public reproduction lab: predkambrij/sshhole-repro
- Public reproduction lab: leonjza/sshhole-lab
- musl mailing list advisory (Rich Felker, 21 October 2026): CVE-2026-107891 multiple integer overflows in regcomp
- musl libc commit 7813e9119eb5fe681b6750b8a033a0490bca0941 (Szabolcs Nagy: regex: avoid int overflow in regcomp)