On November 5, 2026, OpenSSH shipped version 10.6p2 to close a password bypass in sshd. The bug is tracked as CVE-2026-123158 and nicknamed sshole by the researcher who found it, Özgün Kültekin. On a Linux system that uses the musl C library and doesn't check passwords through PAM, an attacker could log in to an account that has no password at all by sending a password longer than 256 bytes.
Alpine Linux is the distribution most people will meet this on, because its default openssh-server package fits that description. Help Net Security reported that the security company Previdian saw its first attack less than nine hours after the CVE was published, and confirmed root access on an Alpine honeypot. Previdian counted eight attempts from one IP address against one sensor, so that is early activity on a small scale. Public proof-of-concept code exists as well, which usually means the attempts grow.
If you build iOS apps, you may be wondering why a Linux login bug belongs on your reading list. Plenty of small app teams run a backend on a cheap VPS, a build helper in a container, or a Dockerfile that an AI tool wrote for them. Alpine is a common choice in all three because the images are small. This guide finds those places in a repo, checks each host or image without changing anything, and walks through the fix and the compromise check.
Who is exposed, and who can stop reading
All of these conditions have to be true at once. They come from Alpine's advisory and Ethiack's analysis.
| Condition | Exposed when | Safe when |
|---|---|---|
| C library | musl | glibc (Debian, Ubuntu, Fedora, RHEL) |
| PAM | openssh-server built without PAM, or openssh-server-pam with UsePAM no | openssh-server-pam with UsePAM yes |
| Password logins | PasswordAuthentication on, which is the OpenSSH default | PasswordAuthentication no |
| Target account | Password field in /etc/shadow is exactly * | Locked accounts with !, and accounts with a real hash |
| Another account | At least one local account has a $5$ or $6$ hash | No $-style hashes on the machine |
| Running sshd | sshd is running and reachable | Containers that don't run sshd |
Two details decide most real cases. Root on Alpine has shipped with * since about Alpine 3.16, but the default PermitRootLogin prohibit-password keeps root out of reach of a password login unless someone changed that line. The account that worries people is the alpine user in the official tiny-cloud images. Images from 3.18.11 through 3.24.3 ship that user with a * password and passwordless doas, so a login there leads to root. Those images become exploitable once any $6$ hash exists on the machine, for example after someone runs passwd to give an account a password. Images built from 3.21.10, 3.22.8, 3.23.8, 3.24.4 and later are fixed.
That second condition is easy to trip by accident. A server can be safe on the day it's created and become exposed the day a teammate adds a user with a password. Keep that in mind when you read a clean result.
Outside Alpine, the researcher names OpenWrt, Buildroot and Yocto, along with "a lot of the docker images", as worth checking. Dropbear and OpenBSD aren't affected, according to the same report.
Why a long password opens the door
Two old decisions met. In 2016, for CVE-2016-6210, OpenSSH changed sshd so that it still hashes the submitted password when an account has no usable hash, borrowing the salt from another account. That hides whether an account exists, because the timing stays similar. Since 2012, musl's crypt() has refused SHA-256 and SHA-512 passwords over 256 bytes, and when it refuses, it returns the string *.
So sshd hashes a very long password with the borrowed salt, musl fails and hands back *, and sshd compares that to the stored value, which is also *. They match, and the login succeeds. On glibc, the same failure returns NULL, which sshd already rejects. The OpenSSH release notes say the root cause lies outside sshd but that sshd can avoid it, and the fix makes sshd refuse any stored hash shorter than a minimum length.
The explanation matters for one practical reason: no amount of password strength helps here, because the account never had a password. Ethiack's write-up lists a CVSS 3.1 score of 8.1 (High).
Step 1: find the places in your repo that might run sshd
Start with what you own. This Python script walks a repository and reports Dockerfile stages built on an Alpine base, any apk add that installs the SSH server, Compose files that publish container port 22, and CI configs that install the server. It only reads files.
#!/usr/bin/env python3
"""List places in a repo that may put sshd on Alpine. Usage: find_ssh_images.py [REPO]"""
import re
import sys
from pathlib import Path
SKIP = {".git", "node_modules", "Pods", "DerivedData", ".build", "vendor"}
FROM = re.compile(r"^FROM\s+(?:--platform=\S+\s+)?(\S+)(?:\s+AS\s+(\S+))?", re.I)
APK_ADD = re.compile(r"\bapk[ \t]+(?:[^;&|\n]*[ \t])?add\b([^;&|\n]*)", re.I)
SERVER_PKGS = {"openssh", "openssh-server", "openssh-server-pam"}
PORT_22 = re.compile(r"""["']?\b\d+:22(?:/tcp)?\b""")
def apk_packages(text):
found = set()
for match in APK_ADD.finditer(text):
tokens = [t for t in match.group(1).split() if not t.startswith("-")]
found |= {re.split(r"[=<>~]", t)[0] for t in tokens} & SERVER_PKGS
return found
def scan_dockerfile(path):
"""Yield (stage base image, sshd packages) for each build stage."""
text = re.sub(r"\\\r?\n", " ", path.read_text(errors="replace"))
stages, aliases = [], {}
for line in text.splitlines():
line = line.strip()
match = FROM.match(line)
if match:
base = aliases.get(match.group(1).lower(), match.group(1))
stages.append([base, set()])
if match.group(2):
aliases[match.group(2).lower()] = base
elif stages and line.upper().startswith("RUN"):
stages[-1][1] |= apk_packages(line)
return stages
def is_dockerfile(path):
name = path.name.lower()
return name == "dockerfile" or name.startswith("dockerfile.") or name.endswith(".dockerfile")
def is_compose(path):
name = path.name.lower()
return path.suffix in {".yml", ".yaml"} and ("compose" in name)
def is_ci(path):
parts = path.as_posix()
return (".github/workflows/" in parts and path.suffix in {".yml", ".yaml"}) or path.name == ".gitlab-ci.yml"
def main():
repo = Path(sys.argv[1] if len(sys.argv) > 1 else ".").resolve()
rows = []
for path in sorted(p for p in repo.rglob("*") if p.is_file()):
rel = path.relative_to(repo)
if SKIP & set(rel.parts):
continue
if is_dockerfile(path):
for base, pkgs in scan_dockerfile(path):
if "alpine" in base.lower():
level = "CHECK" if pkgs else "note"
what = "installs " + ", ".join(sorted(pkgs)) if pkgs else "Alpine base, no sshd package seen"
rows.append((level, str(rel), base, what))
elif pkgs:
rows.append(("CHECK", str(rel), base, "apk adds sshd on an unnamed base image"))
elif is_compose(path):
for number, line in enumerate(path.read_text(errors="replace").splitlines(), 1):
if PORT_22.search(line):
rows.append(("CHECK", f"{rel}:{number}", "-", "publishes container port 22"))
elif is_ci(path):
pkgs = apk_packages(path.read_text(errors="replace"))
if pkgs:
rows.append(("CHECK", str(rel), "-", "CI installs " + ", ".join(sorted(pkgs))))
rows.sort(key=lambda row: row[0]) # CHECK sorts before note
for row in rows:
print(" ".join(row))
if not rows:
print("Nothing found. A base image you build elsewhere can still contain sshd.")
return 1 if any(row[0] == "CHECK" for row in rows) else 0
if __name__ == "__main__":
sys.exit(main())
Run it from your laptop with python3 find_ssh_images.py path/to/repo. Lines marked CHECK deserve a look. Lines marked note are Alpine bases with no SSH server package visible, which is the normal case. The package openssh-client is deliberately ignored, since a client can't accept logins. The exit code is 1 when anything needs checking, so the script can sit in a CI step.
This scan has a limit you should know about. It only sees what the repo spells out. If your Dockerfile starts from a base image that a colleague built elsewhere, the SSH server could be in there without a single matching line. Step 2 catches that, because it looks at the built filesystem.
Step 2: check each host or image
Alpine images don't include Python by default, so the host check is a POSIX shell script that runs under BusyBox. It reads the loader, the apk database, the sshd settings and the password field of each account. It prints account names and never prints a hash.
#!/bin/sh
# sshole_check.sh: read-only exposure check for CVE-2026-123158.
# Usage: sh sshole_check.sh [ROOT]
# no argument = this machine (run as root so /etc/shadow is readable)
# ROOT = an unpacked image, for example from: docker export
# Prints account names only, never hashes.
# Exit codes: 0 no exposure found, 1 could not tell, 2 exposed.
ROOT=${1%/}
fixed_for() {
case "$1" in
3.24) echo 10.3_p1-r2 ;; 3.23) echo 10.2_p1-r1 ;;
3.22) echo 10.0_p1-r11 ;; 3.21) echo 9.9_p2-r1 ;;
3.20) echo 9.7_p1-r6 ;; 3.19) echo 9.6_p1-r3 ;;
3.18) echo 9.3_p2-r4 ;; 3.17) echo 9.1_p1-r7 ;;
3.16) echo 9.0_p1-r6 ;; *) echo "" ;;
esac
}
older() { # true when version $1 sorts below version $2
awk -v a="$1" -v b="$2" 'BEGIN {
n = split(a, x, /[^0-9]+/); m = split(b, y, /[^0-9]+/)
for (i = 1; i <= (n > m ? n : m); i++) {
if (x[i] + 0 < y[i] + 0) exit 0
if (x[i] + 0 > y[i] + 0) exit 1
}
exit 1 }'
}
pkg_version() {
awk -v want="$1" '/^P:/ { p = substr($0, 3) }
/^V:/ && p == want { print substr($0, 3); exit }' \
"$ROOT/lib/apk/db/installed" 2>/dev/null
}
# First value wins, as in sshd_config. Stops at the first Match block.
opt() {
name=$2
if [ -z "$ROOT" ] && [ -n "$EFFECTIVE" ]; then
v=$(printf '%s\n' "$EFFECTIVE" | awk -v k="$1" 'tolower($1) == k { print tolower($2); exit }')
else
# shellcheck disable=SC2086
v=$(cat "$ROOT"/etc/ssh/sshd_config.d/*.conf "$ROOT/etc/ssh/sshd_config" 2>/dev/null |
awk -v k="$1" '{ sub(/\r$/, ""); gsub(/=/, " ") }
tolower($1) == "match" { exit }
tolower($1) == k { print tolower($2); exit }')
fi
echo "${v:-$name}"
}
if ! ls "$ROOT"/lib/ld-musl-*.so.1 >/dev/null 2>&1; then
echo "OK: no musl loader found, so this bug does not apply."; exit 0
fi
if [ ! -x "$ROOT/usr/sbin/sshd" ]; then
echo "OK: musl, but no /usr/sbin/sshd in this filesystem."; exit 0
fi
EFFECTIVE=""
[ -z "$ROOT" ] && EFFECTIVE=$(sshd -T 2>/dev/null)
pam_ver=$(pkg_version openssh-server-pam)
srv_ver=$(pkg_version openssh-server)
ver=${pam_ver:-$srv_ver}
branch=$(cut -d. -f1,2 "$ROOT/etc/alpine-release" 2>/dev/null)
fixed=$(fixed_for "$branch")
echo "sshd found. Alpine branch: ${branch:-unknown}. Package: ${ver:-not from apk}."
if [ -n "$pam_ver" ] && [ "$(opt usepam no)" = "yes" ]; then
echo "OK: openssh-server-pam with UsePAM yes."; exit 0
fi
if [ "$(opt passwordauthentication yes)" = "no" ]; then
echo "OK for now: PasswordAuthentication no. Still upgrade the package."; exit 0
fi
shadow="$ROOT/etc/shadow"
if [ ! -r "$shadow" ]; then
echo "UNKNOWN: cannot read $shadow. Run as root."; exit 1
fi
root_login=$(opt permitrootlogin prohibit-password)
stars=$(awk -F: -v r="$root_login" '$2 == "*" && ($1 != "root" || r == "yes") { printf "%s ", $1 }' "$shadow")
hashes=$(awk -F: '$2 ~ /^\$[56]\$/ { n++ } END { print n + 0 }' "$shadow")
echo "Accounts with a bare * that sshd could log in: ${stars:-none}"
echo "Accounts with a \$5\$ or \$6\$ hash: $hashes"
if [ -z "$ROOT" ]; then
# An upgraded package does not replace a daemon that is already running.
for pid in $(pidof sshd 2>/dev/null); do
case "$(readlink "/proc/$pid/exe" 2>/dev/null)" in
*deleted*) echo "WARNING: sshd pid $pid runs a deleted binary. Restart it." ;;
esac
done
fi
if [ -z "$fixed" ] || [ -z "$ver" ]; then
echo "UNKNOWN: no fixed-version entry for this branch or package."
echo "Check the Alpine advisory, or set PasswordAuthentication no."; exit 1
fi
if ! older "$ver" "$fixed"; then
echo "OK: package $ver is at or above the fixed $fixed. Confirm sshd was restarted."; exit 0
fi
if [ -n "$stars" ] && [ "$hashes" -gt 0 ]; then
echo "EXPOSED: package $ver is below $fixed and password logins are on."; exit 2
fi
echo "NOT EXPOSED TODAY, but one new user or password could change that."
echo "Package $ver is below $fixed, so upgrade it anyway."; exit 0
On a running server, copy it over and run sudo sh sshole_check.sh, or use doas on Alpine. Root is needed to read /etc/shadow. With no argument it asks sshd -T for the effective settings, and it warns you if a running sshd is still using a binary that has since been replaced on disk.
For an image, you don't need to start anything. Export its filesystem and point the script at the folder:
docker create --name sshcheck myimage:tag
mkdir -p /tmp/sshcheck
docker export sshcheck | tar -x -C /tmp/sshcheck --exclude='dev/*'
sh sshole_check.sh /tmp/sshcheck
docker rm sshcheck
In this mode the script reads the config files directly. It takes the first value it finds, reading the drop-in folder first and stopping at the first Match block, since a setting inside a Match applies only to some connections. If your config uses Match or an unusual Include layout, confirm the answer on a running copy with sshd -T.
| Result | Exit code | What to do |
|---|---|---|
| OK | 0 | Nothing is exposed on this measure. If it says "OK for now", upgrade the package anyway. |
| NOT EXPOSED TODAY | 0 | The package is old, but one condition is missing. Upgrade before someone adds a password. |
| UNKNOWN | 1 | The script couldn't read /etc/shadow, or the branch or package isn't in its table (edge, OpenWrt, a hand-built sshd). Check by hand or turn password logins off. |
| EXPOSED | 2 | Go to Step 3 and Step 4 now. |
Step 3: fix it, and watch for two traps
The first trap is the version number. Many write-ups say "update to OpenSSH 10.6p2", but Alpine backported the fix, so its stable branches keep their older version numbers. A package at 10.0_p1-r11 on Alpine 3.22 is patched. A scanner rule that looks only for 10.6p2 will call it vulnerable. These are the fixed packages listed by Alpine:
| Alpine branch | Fixed openssh package |
|---|---|
| edge | 10.6_p2-r0 |
| 3.24 | 10.3_p1-r2 |
| 3.23 | 10.2_p1-r1 |
| 3.22 | 10.0_p1-r11 |
| 3.21 | 9.9_p2-r1 |
| 3.20 | 9.7_p1-r6 |
| 3.19 | 9.6_p1-r3 |
| 3.18 | 9.3_p2-r4 |
| 3.17 | 9.1_p1-r7 |
| 3.16 | 9.0_p1-r6 |
Alpine 3.21 reached end of support on November 1, 2026, and branches 3.16 to 3.20 no longer receive regular updates. Alpine published fixes for all of them this time. If you're on one of those, treat this as a prompt to plan the move to a supported branch.
The second trap is the running daemon. Upgrading the package doesn't replace the sshd process that is already in memory. On an OpenRC system, do both:
apk upgrade -U -a
rc-service sshd restart
If you can't upgrade right now, turn password logins off. Keep an existing SSH session open while you test a new one, so a typo can't lock you out. Alpine notes that a drop-in file works on 3.19 and later:
echo 'PasswordAuthentication no' > /etc/ssh/sshd_config.d/10-no-passwords.conf
sshd -t
rc-service sshd restart
sshd -T | grep -i passwordauthentication
On older branches, put the same line near the top of /etc/ssh/sshd_config. sshd uses the first value it reads for most options, so a later line won't override an earlier one. Check that no key-only assumptions are wrong before you do this: anyone who still logs in with a password will be shut out.
For images, a host-level upgrade changes nothing. You need a new build, and a layer cache can hand you the old package again:
docker build --pull --no-cache -t myimage:tag .
Look in the Dockerfile for pinned versions such as openssh-server=10.0_p1-r10, since a pin keeps the old package through any rebuild. Then redeploy, because a rebuilt image does nothing for containers already running. If a container only has sshd so that someone can get a shell, docker exec does that job and you can drop the server from the image.
Step 4: check whether anyone already got in
If the script said EXPOSED and the machine was reachable from the internet, assume you need to look. Alpine's advisory and the follow-up reporting suggest the same starting point:
grep 'Accepted password for' /var/log/messages
Any successful password login to an account that has no password, such as alpine, root or a key-only service user, is a serious finding. Alpine's advisory points at /var/log/messages; if you ship logs elsewhere, run the same search there. A container may keep no log at all unless you set that up, and a missing log proves nothing. Then review doas use, recently created users, changed files and every authorized_keys file.
The attacks Previdian described ran id, uname and hostname through non-interactive SSH sessions, using passwords over 256 characters. No general list of network indicators has been published, according to Ethiack, so a clean IP check doesn't clear you.
If you can't rule out a login, treat the machine as compromised. Rebuild it from a fixed image and replace every secret it could read. For an app team that list often includes an App Store Connect API key, an APNs key, a Firebase service account, database passwords and deploy tokens. Rotating those is tedious, and it is still far cheaper than discovering later that someone kept a copy.
One warning on testing. Proof-of-concept exploits have appeared on GitHub, and Previdian says they are unverified and could contain malware. You don't need one to learn whether you're exposed, because the conditions in the table can all be read directly. Leave those repos alone.
Make the next one less urgent
A few small habits would have turned this from an emergency into a routine package update.
Make key-only login the default on every server you create, with PasswordAuthentication no set at provisioning time. If an AI coding tool writes your server setup or Dockerfiles, add that rule to your project's instruction file, and ask it to explain any line that installs an SSH server or publishes port 22. A generated Dockerfile can include one without anyone asking for it.
Avoid running sshd inside containers unless the container's whole purpose is SSH. Each one is a login service that needs patching, and images tend to be rebuilt less often than anyone assumes.
Lock accounts with ! if you manage them by hand. For this bug, Alpine lists ! accounts as unaffected, while * was the problem value. Check what your provisioning scripts write.
Put the checks in the pipeline. The Python script can run on every pull request and the shell script can run against each exported image, failing the job on exit code 2. Rebuild images on a schedule too, so a fixed package reaches you without anyone remembering to ask for it.
Finally, write down where sshd is running. Most of the work above is finding the machines. A short list in your repo, with who owns each host and how it's patched, makes the next advisory a much shorter job.
What was tested for this article
The shell script passed shellcheck and was run under dash against 15 hand-made filesystem fixtures. They covered exposed and fixed packages, a higher-than-fixed version, config variants including a drop-in file, key=value syntax and a setting inside Match, PAM on and off, root-only accounts, no hashes, no sshd, no musl, and an unreadable shadow file. The running-host path was exercised with a stub sshd on a throwaway Linux machine, including the deleted-binary warning. The Python scanner was run on a small sample repo. Testing it turned up one regex bug, which is fixed in the version above.
None of this ran on a real Alpine system, and no exploit was run against anything. The docker export, apk, rc-service and docker build commands come from the vendors' documented usage and weren't executed for this article. Treat the script as a triage helper, and let Alpine's advisory be the final word on your branch.
A note on small scripts like these
The repo scanner above is about 80 lines of standard-library Python, and small tools of that kind are worth keeping around. If you want a larger set to study or adapt, the Python Automation Scripts Pack: 100 Useful Projects for Freelancers is a $9 download on Gumroad. It has 100 completed Python automation projects with source code, README files, sample input and output, tests and a PDF guide, covering jobs like organizing files, cleaning CSV data, monitoring websites and generating reports. It is a general automation pack, and its page doesn't list any security tools.

Comments