Skip to content
Exploit for Unexpected Status Code or Return Value in Openbsd Openssh

Exploit for Unexpected Status Code or Return Value in Openbsd Openssh

Sploitus • November 17, 2026

[![shellcheck](

![license](

Read-only audit for **CVE-2026-123158** ("sshole"): an OpenSSH `sshd` password

authentication bypass on **musl libc without PAM**. Alpine Linux is the main

example; Yocto, OpenWrt, Void (musl) and Wolfi are in the same situation.

Written in **POSIX sh**, so it runs as is on Alpine's busybox `ash` (no

`apk add bash`), on dash and on bash. It never runs an exploit and never prints

It also prints a short **basic SSH hardening report** (empty-password accounts,

root login, weak algorithms, file permissions). That section is informational

and never changes the CVE verdict or the exit code.

`sshd` without PAM checks a password with `crypt()` and compares the result with

the shadow password field. musl's `crypt()` returns `*` as its error value for

keys longer than 256 bytes, and `*` is exactly what an account with no password

stores. When the stored field is too short to carry a salt, `sshd` borrows the

salt of another account, the computed value equals the stored `*`, and the login

succeeds. On affected setups **any password of 257 to 1024 bytes works** for such

an account. Fixed upstream in OpenSSH **10.6p2**.

### All of these must hold (Alpine advisory, 2026-11-05)

| 1 | `sshd` without PAM | `openssh-server`, or `openssh-server-pam` with `UsePAM no` (the Alpine default) |

| 2 | `PasswordAuthentication yes` | the OpenSSH default |

| 3 | an account with `*` as password field | `root` on Alpine 3.16+, key-only users, the `alpine` user of tiny-cloud images |

| 4 | an account with a `$...` hash | an admin set a password for someone |

Not affected: containers without `sshd`, `PasswordAuthentication no`,

`UsePAM yes` with a PAM build, systems where no account has a `$` hash.

# review it first, then run as root (sshd -T and /etc/shadow need root)

wget -O cve-2026-123158-audit.sh

sh cve-2026-123158-audit.sh # text report

sh cve-2026-123158-audit.sh --json # JSON on stdout

sh cve-2026-123158-audit.sh --quiet # only the verdict word, plus the exit code

sh cve-2026-123158-audit.sh --no-hunt # skip the log grep

Without root the result is `UNKNOWN` unless the package is already fixed and

| 0 | `PATCHED` | fixed package and a daemon that runs it |

| 0 | `NOT_APPLICABLE` | not a musl system, or no `sshd` installed or running |

| 1 | `MITIGATED` | unfixed code, but no reachable entry path right now. Still patch |

| 2 | `VULNERABLE` | exposed, or **indicators of exploitation** found in the logs |

| 3 | `UNKNOWN` | cannot decide (not root, odd package version). Treat as suspect |

| 4 | | usage error or missing basic tools |

Same scheme as the other audits in this family (`cve-2026-99999-audit` and

others): 0 clear, 1 mitigated, 2 vulnerable, 3 unknown, 4 error.

## Basic SSH hardening checks (informational)

Read from the effective `sshd -T` output and a few file modes. Each line is

`[FAIL]`, `[WARN]` or `[ ok ]`, with a summary count. **They do not change the

verdict or the exit code**, so scripts that rely on exit codes 0 to 4 behave as

before. In `--json` they appear as `hardening_fail`, `hardening_warn` and a

`hardening` array of `"LEVEL: text"` strings; `empty_password_account_names`

| accounts with an empty password field, listed by name | FAIL if `PermitEmptyPasswords yes` (reachable over SSH), otherwise WARN (usable at a console or with `su`) |

| `StrictModes no`, `PermitUserEnvironment yes`, `HostbasedAuthentication yes` | FAIL |

| host private key readable by group or other | FAIL |

| `/etc/ssh/sshd_config` writable by group or other, or (on a real root) not owned by root | FAIL |

| `KbdInteractiveAuthentication yes` together with `UsePAM yes` | WARN |

| weak ciphers (CBC, arcfour, blowfish, cast128), MACs (MD5, SHA-1, umac-64), key exchange (SHA-1), SHA-1 or DSA host and user key algorithms | WARN, with the entries named |

Note that OpenSSH's default MAC list still contains `hmac-sha1` and

`umac-64`, so a stock Alpine install reports weak MACs. That is real, but a

Not covered: `Match` blocks (global values only), `AllowUsers`/`AllowGroups`,

crypto policy beyond the weak-entry patterns, `authorized_keys` contents, SSH

rc-service sshd restart # the upgrade does NOT replace the running daemon

Fixed `openssh` builds (from OSV `ALPINE-CVE-2026-123158`):

| Alpine | fixed build | Alpine | fixed build |

| 3.22 | 10.0_p1-r11 | 3.16 | 9.0_p1-r6 |

If you cannot update now, set `PasswordAuthentication no` (check with

`sshd -T | grep -i passwordauthentication`) and test key login in a second

- **Package.** On Alpine the owner of the running `sshd` binary is asked from

`apk`, and its version is compared with the fixed build **of its own upstream

series** (so a package from another branch is judged correctly). `sshd -V` is

deliberately not used on Alpine: fixes are backported, and `10.0_p1-r11`

still prints `OpenSSH_10.0p2`. A series that is not in the table is

`UNKNOWN`, one older than any fixed release (before 9.0) is unfixed.

- **Other musl hosts.** Only the upstream version from `sshd -V` can be used.

10.6p2 or newer is `PATCHED`. Anything lower cannot be proven unfixed, because

a distribution may have backported the fix, and the report says so.

- **Restart.** If the package is fixed but `/proc/PID/exe` points to a deleted

file, the daemon still runs the old code, and the host is judged as unfixed.

- **PAM.** `sshd -T` prints no `usepam` key when the build has no PAM. With a PAM

build, `UsePAM yes` is a mitigation, `UsePAM no` is not.

- **Accounts.** Field types in `/etc/shadow`: `*`, `$...`, `!`, empty. Only the

names of `*` accounts are shown, never hashes.

- **Log hunt.** `Accepted password for ` in `/var/log/messages`,

`auth.log`, `secure` or `syslog`. An account with no password cannot log in

with a password legitimately, so a hit means exploitation. It forces

`VULNERABLE` even on a patched host, because that host needs incident

- **Locked accounts (`!`).** The Alpine advisory says they are not affected.

An independent report on oss-security (Medcrypt, 2026-11-09, reproduced on a

stock Yocto image) lists "locked service accounts" and a two-attempt

requirement tied to `pick_salt()` caching. These two descriptions differ. The

audit follows the Alpine advisory for the verdict and prints a note when `!`

- **Match blocks.** `sshd -T` shows global values. A `Match` block that sets

`PasswordAuthentication yes` is detected and treated as exposure, but

per-user or per-address evaluation is not done.

- **Directory users** (nslcd, sssd, winbind, musl-nscd) have no shadow entry

and may count as `*` accounts. The audit only notes that such a service is

- The log hunt reads the current log files only: not rotated logs, not remote

syslog. Logs can be tampered with by an attacker who got in.

- Reachability of the SSH port (firewall, network placement) is not tested.

sh tests/run_tests.sh # 143 tests against fake roots (141 where python3 is absent), as a normal user

sh tests/docker_tests.sh # the same suite under busybox ash, dash, bash 4.2 and 4.3,

# plus an end-to-end run on a real Alpine with a running sshd

The tests use `CVE_2026_123158_TEST_ROOT` and `CVE_2026_123158_TEST_PATH`. Both

are **ignored when the script runs as root**, so they cannot change a real

audit. The table of fixed builds in `tests/fixtures/fixed-builds.txt` is an

independent copy of the OSV data, so the script is not checked against its own

table. Every verdict-relevant check was mutation-tested: breaking it on a copy

- `examples/sample-output-patched.txt` and `.json`: a real run on Alpine 3.22.8

with the fixed `openssh-server 10.0_p1-r11` (taken before the hardening section

was added; run the script for the current layout).

- `examples/sample-output-vulnerable-fixture.txt`: an exposed host. **This is a

synthetic fixture** (a fake root with the unfixed build `10.0_p1-r2`), because

I did not run an unfixed `sshd` to capture it.

- OSV: `CVE-2026-123158` and `ALPINE-CVE-2026-123158` on

Extracted Entities