A researcher finds OpenSSH on musl-based Linux, such as Alpine, accepted any 257+ character password for accounts with no password
An interactive, illustrated history of how a 1980 Unix convention and a 2012 libc change lined up into a login bypass, with a self-check for your own servers.
Özgün Kültekin of the security firm Wakefield published an illustrated write-up (under a pun on "ssh") of a login bypass in OpenSSH on Linux systems built on the musl C library, such as Alpine, OpenWrt, Buildroot and Yocto, when sshd runs without PAM. Locked or key-only accounts are marked with a "" instead of a password hash. Since 2012, musl's crypt() returns "" when it fails, and it fails on passwords over 256 bytes. Because sshd hashes a wrong password even for such accounts, a password of 257 to 1,024 characters produced "*" and matched. He says the flaw has existed since 2016 and that on Alpine's official AWS and Azure images the default user, which has passwordless doas, is affected, which amounts to root.
He says he found it by testing about 17,600 unusual logins across many sshd builds with "agent swarms". OpenSSH 10.6p2, released November 5, works around it in sshd; the OpenSSH team says it considers the root cause outside sshd. The fix is to upgrade or turn off password logins, and his GitHub repo has a check script.
-
crypt (C)
After exploring *ss***e · sshhole.com, to see the function at the center of the bug, read about crypt (C).
Covers the POSIX C library function used to hash account passwords, whose output string encodes the salt and the hash algorithm.
Wikipedia · Wade · 5 min
0 -
musl
After exploring *ss***e · sshhole.com, for the library under Alpine and many containers, try musl.
The entry on musl, the MIT-licensed C standard library for Linux written by Rich Felker as a clean, standards-conformant alternative to glibc.
Wikipedia · Wade · 5 min
0