Murat BekgiPenetration tester
Subscribe
Write-ups

Week 46: sshole lets attackers into Alpine SSH without a password. Check yours

CVE-2026-123158 bypasses SSH passwords on Alpine and other musl systems, and it's being exploited. How to check, patch, restart and look for break-ins.

Published
Reading time
3 min
Topic
Weekly
Contents
  1. What happened
  2. Walkthrough: check, patch, restart, hunt
  3. The takeaway for testers

November 4 to 10. The story that wouldn’t go away this week had the best name of the year: sshole. It’s a way to log into certain SSH servers without knowing the password, including accounts that were never supposed to accept passwords at all.

What happened

On November 5 the OpenSSH project shipped Portable OpenSSH 10.6p2 to close a password authentication bypass, and Alpine Linux published an advisory the same day telling everyone running sshd to update and restart (Rescana, Alpine). It’s tracked as CVE-2026-123158 and rated 8.1 (Field Effect). The researcher’s write-up is at sshhole.com.

It didn’t stay theoretical. Scanning for it showed up within days (SANS ISC), and CISA added it to the Known Exploited Vulnerabilities catalog on November 9 (write-up).

The good news is that it needs a very specific setup. All of these have to be true (Neoteo):

  • sshd runs on Linux with musl libc, not glibc. Alpine is the big one, including a lot of Docker images.
  • sshd is not using PAM.
  • Password authentication is enabled, which is OpenSSH’s default unless you turned it off.
  • The target account has a * in its password field.
  • At least one other local account has a real $5$ or $6$ password hash.

OpenSSH’s Damien Miller says it doesn’t exist on non-Linux systems, on glibc Linux, or on Linux that uses PAM for passwords (Rescana). So your Ubuntu and RHEL boxes are fine. Your Alpine containers with sshd in them may not be.

Below is how to check, fix and hunt. There’s no exploit here and you don’t need one.

Walkthrough: check, patch, restart, hunt

Run these as root on the box, or inside the container with docker exec -it NAME sh.

1. Are you on musl? On Alpine this file exists. On other distros, ldd tells you.

cat /etc/alpine-release 2>/dev/null
ldd --version 2>&1 | head -1

If you see an Alpine version or musl libc, keep going. If you see GNU libc, you’re not affected by this one.

2. Is sshd using PAM, and does it allow passwords? sshd -T prints the settings sshd is actually running with, after all the include files.

sshd -T | grep -Ei '^(usepam|passwordauthentication) '

You’re in the danger zone if passwordauthentication yes shows up and usepam is no or missing.

3. Do you have the account mix the bug needs? This prints account names only, never hashes:

awk -F: '$2 ~ /\*/ {print "star  " $1} $2 ~ /^\$[56]\$/ {print "hash  " $1}' /etc/shadow

At least one star line plus at least one hash line means the conditions line up.

4. Check the openssh version.

apk info -v openssh-server

Alpine’s fixed builds, per branch (Alpine advisory, via Xenospectrum):

Alpine Fixed openssh
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

Alpine shipped fixes back to 3.16. If you’re older than that, it’s time to move.

5. Update, then restart sshd. This step is the one people skip. Installing the package doesn’t touch the sshd that’s already running.

apk update && apk upgrade openssh openssh-server
rc-service sshd restart

6. Can’t update today? Turn passwords off. Set this in /etc/ssh/sshd_config and check for an override in /etc/ssh/sshd_config.d/:

PasswordAuthentication no

Then test the config before restarting, so you don’t lock yourself out:

sshd -t && rc-service sshd restart

Using PAM (openssh-server-pam with UsePAM yes) also blocks it (Magica).

7. Containers: rebuild, don’t patch in place. A running container you upgraded by hand goes back to the old version on the next deploy. Find Alpine containers that run sshd:

for c in $(docker ps --format '{{.Names}}'); do
  docker exec "$c" sh -c 'test -f /etc/alpine-release && command -v sshd >/dev/null && echo "$(hostname) alpine with sshd"' 2>/dev/null
done

Then update the base image, rebuild and redeploy. While you’re in there, ask why the container runs sshd at all. docker exec usually does the job.

8. Hunt for a successful login. The tell is a password login to an account that should only ever use keys. On Alpine with syslog enabled:

grep -E 'sshd.*Accepted password for' /var/log/messages

Any “Accepted password” for a key-only or service account is worth treating as a break-in until you can explain it. Check ~/.ssh/authorized_keys on that account for keys you didn’t add, too.

The takeaway for testers

This one fits a pattern worth remembering on engagements: the bug wasn’t in one component. It came from a library quirk meeting a build option meeting a default setting. Container images built on Alpine with sshd baked in are exactly where that combination hides.


New write-ups and both weekly posts land in the inbox — subscribe, or grab the RSS feed.