OpenBSD OpenSSH password auth bypass in sshd with musl libc
Summary
OpenSSH's sshd on Linux is affected when it runs with musl libc and without PAM (Alpine Linux is one example), because a password authentication bypass lets an attacker log in with any password between 256 and 1024 characters on some account configurations. The attacker can reach it remotely, without logging in, but it needs a non-default setup. Public exploit code exists and the bug is being exploited in attacks.
Details
sshd in OpenSSH before 10.6p2 on Linux, when musl libc is used without PAM, lacks a workaround for a password authentication bypass (related to misinterpretation of whether a string is intended to be a password hash). For some configurations of accounts, any password between 256 and 1024 characters succeeds. An example of a platform using musl libc without PAM is Alpine Linux.
Affected
Affects OpenSSH sshd before 10.6p2 on Linux systems using musl libc with PAM support disabled, which the release notes call a critical workaround. Fixed in 10.6p2.
Suggested Fix
Upgrade to 10.6p2.
References
- https://www.openssh.org/releasenotes.html#10.6p2
- https://github.com/openssh/openssh-portable/commit/4353fdc43ef646c43a8dda7025cc1a898caf1482
- https://news.ycombinator.com/item?id=50377976
- https://news.ycombinator.com/item?id=50378228
- https://marc.info/?l=openssh-unix-dev&m=179388064263131&w=2
- https://hachyderm.io/@damienmiller/117563026759098135
- https://github.com/predkambrij/sshhole-repro
- https://github.com/leonjza/sshhole-lab