Sshole sshhole.com · 566 points · 146 comments · HN thread TL;DR A web write-up ...
HN Best 30 @best30
Sshole sshhole.com · 566 points · 146 comments · HN thread
TL;DR A web write-up called Sshole describes a chain of decisions in musl libc and OpenSSH that let a wrong password succeed against accounts whose password field is '' or '!' when sshd is built with musl and without PAM. The author says they found it with AI agent swarms, testing about 17,600 logins across builds, and that every build agreed except musl without PAM. The story centers on '' as an in-band error sentinel that became a valid-looking hash match.
- Unix /etc/passwd and later /etc/shadow use '*' (and '!') to mark accounts that cannot log in, since no password hash can equal them.
- musl's crypt() stopped returning NULL on failure and returns '' instead (2012), so callers that never check for NULL compare against '' and can match a disabled account's field.
- musl's SHA-512 crypt rejects passwords longer than 256 bytes to limit DoS cost, and on that failure it also returns '*'; OpenSSH's timing mitigation for nonexistent users passes another user's real hash, which creates the match.
- Exploitation needs musl, no PAM, and password authentication on, and an account with a disabled-style field; default Alpine installs with PAM are not affected, and Alpine shipped a fix in 3.16 via openssh updates.
- Several commenters tested it: most default Alpine setups with updated openssh-server did not reproduce, while some older or unpatched versions did.
- The author says a Debian bug in 2013 and a musl list thread in 2024 came close to the same issue, and the write-up covers the history from 1980 onward.
Discussion The thread mixes technical analysis, design debate, and practical testing. Early comments explain the mechanism step by step and then move to a broader argument about in-band sentinel values, C's lack of sum types and exceptions, and whether crashing loudly beats silent compatibility hacks. A second strand asks whether the bug is exploitable in practice: several people tried to reproduce it on Alpine and mostly failed on updated packages, and others pointed out that Docker and OpenWrt defaults make it less likely. There are also sharp criticisms of musl's maintenance and of the write-up itself, including its scroll-jacking animations and its AI-assisted origin, plus a fair amount of jokes about the name. Overall the mood is skeptical and mildly exasperated, with more interest in the design lessons than in alarm.
- Sentinel values like '*' are the root design flaw (many): Commenters argue in-band signaling in plain-text Unix formats and C APIs made this inevitable. Several suggest sum types, Result types, or exceptions would have prevented it.
- Silently returning '*' was a bad musl design decision (many): Critics say hiding a caller error to avoid crashes trades visible failures for hidden security bugs, and some call musl unreliable in production.
- Crashing loudly is better for security code (some): Some argue programs should fail on unexpected states, especially in password handling, while others note servers and live media often need to keep running with degraded behavior.
- Not reproducible on default Alpine; narrow conditions (some): Several testers on updated Alpine and OpenSSH could not reproduce it, and they note it needs musl, no PAM, password auth, and a specific account state. Some people did reproduce it on older or unpatched builds.
- Key auth is still safer than passwords (some): A thread argues that keys resist guessing better and avoid sending secrets to the server, though others point out password reuse and key theft risks.
- Site design and AI origin are distracting (some): Commenters complain about scroll hijacking and animations, and suspect AI generation, while others find the write-up clear and well made.
Links from the comments
- Explanation of in-band signaling, the core concept in the top comment.
- Contest for code that looks correct but hides malicious behavior, raised as a possible explanation.
- OpenSSH post-quantum guidance, relevant to a warning many OpenWrt users saw.
- Section of the site that lists who is affected, suggested to readers who want a quick answer.
- Rust discussion on panic and unwinding trade-offs, cited in the crash-versus-continue debate.
#security #musl #openssh #authentication #cLibrary #vulnerability