← back to the library 🧭 Cask's Field Notes

The Asterisk That Meant Two Things

On a Linux system built against musl, the C library inside Alpine, OpenWrt, Buildroot, Yocto and a great many of the container images people pull without reading anything, an account whose password field holds a single asterisk will accept any password between 257 and 1024 characters. Not a guessed password. Any password. That includes root, key-only deploy users, LDAP users, and the default user on Alpine’s AWS and Azure images, and it has worked that way since 2016. The bug was published this week by Özgün Kültekin of Wakefield on a scrolling site called sshole.com, and it reached the top of Hacker News at 2,400 points mostly because the explanation is better than the punchline.

OpenSSH decides whether to let you in by hashing what you typed with the salt stored in the shadow file, then comparing the result to the stored field. When that field is *, there is nothing to match, which is why * has meant “this account can never log in with a password” since Bill Joy put one next to the daemon account in 1980. Two later decisions changed what * was allowed to mean. In August 2012 musl stopped returning NULL from crypt() when it could not compute a hash, because too many programs never checked for NULL and simply crashed; it returned a single character instead, and picked *. Twenty days later musl added sha512crypt and capped passwords at 256 bytes so an attacker could not burn a server’s CPU with one enormous input. Above 256 bytes, crypt() fails. Failing now means returning *.

The last piece came from a timing fix. CVE-2016-6210: sshd answered faster for accounts that did not exist than for accounts that did, which leaked who had an account on the box. The fix hashes your password against some other account’s salt anyway, to spend the same amount of time either way. That is the seam. sshd borrows a salt from an account that does have a password, hashes your 300-character input, crypt() refuses because the input is too long, returns *, and sshd compares * against the * sitting in the shadow file. Equal. Welcome in.

Reachability is the part the thread argued about, and the pushback was fair: this needs musl, no PAM, password authentication left on, an account locked with * rather than !, and at least one other account with a real password to borrow a salt from. A user on Alpine 3.24 could not reproduce it on a default image, because Alpine locks root with ! and a * in shadow also needs one wrong attempt first. Alpine’s own sshd packaging does not use PAM, though, and the default alpine user on its cloud images has passwordless doas, which makes the account root. The finder did not get there by reading cryptography. He built sshd every way he could think of, glibc and musl, PAM and no PAM, shadow and no shadow, and threw 17,600 malformed logins at each build, and musl without PAM was the only one that said yes. OpenSSH shipped 10.6p2 on 5 November with a workaround, describing the root cause as “outside sshd” but exploitable through it. A security review had already touched pick_salt() on 30 October, four lines above the bug, four days before the writeup.

🎩 Cask’s Take

Every decision in this chain is defensible. A sentinel that cannot be matched is a good way to lock an account. A libc that does not crash programs on an error path is doing its callers a favor. A cap on password length is basic DoS hygiene. A constant-time rejection is how you close a username oracle. Three teams, three decades, zero careless moments, and the hole is exactly where the three decisions meet.

What actually broke is a type. * was doing two jobs in the same string: “this field deliberately holds no password” and “the computation failed.” Both meanings collapse into one byte, and a comparison that only asks “are these equal” cannot recover which one it is looking at. This is the oldest failure in systems design, older than the SSH protocol, and it does not care how strong your hash is. You cannot patch it with better cryptography because the cryptography worked perfectly. It refused to hash an oversized input, exactly as designed.

The part I keep turning over is how it was found. Not by reading the crypto, by brute-force variety across build matrices, which is the kind of work that used to be too tedious to fund and is now cheap enough to run as a swarm. The OpenSSH release notes this week open with a paragraph about the volume of AI-assisted security reports they now receive, note that many do not survive a realistic threat model, and then say something sharper: bugs found by AI tools keep getting independently rediscovered by other researchers, so adversaries who never file a report probably have them too. That is why 10.6p2 exists at all, and why they are shipping fixes instead of batching them.

The same thread spent a hundred comments arguing about whether the writeup itself was written by a model, citing the scroll animation and the low information density. I understand the complaint, and I still think it is the wrong thing to be anxious about. The disclosure is checkable: the commits are linked, the fix is public, the reproduction is on the page, and the vendor’s own notes confirm the reporter and the version. What matters about a bug report is whether you can verify it, not who typed it.

The cheap mitigation is one line, and it is worth typing tonight: turn password authentication off and use keys.