The SSH Bypass Needed 257 Bytes, a Starred Account and a Borrowed Salt

In short
Key takeaways
- The accepted password window is 257 to 1024 bytes, because sshd discards anything above 1024 and musl rejects anything above 256.
- The bypass requires a shadow field of exactly
*; accounts locked with!, which is whatpasswd -lwrites, do not match. - OpenSSH 10.6p2 shipped on 2026-11-05 and Alpine backported the fix across 3.16 to 3.24 and edge.
- Upgrading the package is not enough on its own, because a running sshd keeps the vulnerable code until it is restarted.
- glibc, libxcrypt, PAM builds, Dropbear and the OpenBSD builds were never affected by this path.
- No primary source has published a count of exposed hosts or confirmed in-the-wild exploitation.
OpenSSH 10.6p2 landed on 2026-11-05 with a four-character length check in the password verifier. Any stored password field shorter than that is now rejected before it is ever handed to the C library. The constant is MIN_PASSWORD_HASH_LEN and it is 4. The reason it exists is that a one-character field, *, was matching a password of 257 bytes or more on Linux systems built against musl with PAM turned off.
That is the whole bug, once you know the ending. Getting there takes three decisions made years apart, in three different projects, each defensible on its own, which is why the failure survived a fuzzing campaign that logged roughly 17,600 login attempts before it surfaced.
The comparison sshd actually makes
Password authentication in sshd reduces to one expression. It calls crypt() with the candidate password and a salt, then compares the returned hash against the value stored in the shadow database. If the two strings are equal, the login proceeds.
Everything that follows depends on that comparison being exact. It is a string equality test, not a verification routine with its own opinion about what a stored value means. If crypt() can be made to return something that equals what is in the shadow file, sshd has no further question to ask. Normally that is safe, because a real hash is a 106-character string beginning with $6$ for sha512, and matching it requires knowing the password.
musl returns a sentinel instead of failing
musl made a decision in August 2012 that a failed crypt() should return the string * rather than a null pointer. The commit message says it plainly: return an unmatchable hash rather than NULL on failure. The argument for it is reasonable. Callers that forget to check for a null pointer get a string that matches nothing instead of a crash.
Two months later musl added sha256 and sha512 support with a key cap. The constant is KEY_MAX 256, and the comment in the source admits the cap is not part of the original design, it was added for denial of service protection. Hashes over 256 bytes are expensive to compute, so the library refuses them. The header comment states the behaviour without ambiguity: on error, * is returned.
So musl has a rule that a password longer than 256 bytes produces the string *, and a rule that any internal failure produces the string *, and no way for the caller to distinguish those from a successful hash. The sentinel is one character long. A real hash starts with a scheme identifier and runs past a hundred.
Except that one character long string is exactly what Unix has used since 1980 to mean an account has no usable password. The 3BSD password file used * in the daemon entry, and the convention has not moved since. A field of * means no password can match.
sshd borrows a salt from a neighbour
The second decision came from OpenSSH in July 2016, as the fix for CVE-2016-6210. The problem then was timing. If sshd rejected an unknown username instantly but spent 100 milliseconds hashing a real user's password, an attacker could enumerate valid accounts by clock. The fix was pick_salt(), which gives invalid users a plausible salt to hash against so they take the same time to reject as everyone else.
That means sshd will reach into another account's hash and use its salt. The salt sits inside the stored hash, so any machine with one real password on it has one to lend.
When the target account's stored field is short, too short to contain a salt at all, sshd does not pass * to crypt(). It passes the borrowed salt. The one-character marker never reaches the function that would have recognised it.
The workaround that did not fire
musl already knew about the collision in one code path. The DES implementation ends with a conditional that returns x when the salt begins with *, specifically to avoid handing back a value that looks like a locked account.
The guard tests the salt argument. Under salt borrowing the salt is somebody else's real $6$ hash, so the first character is a dollar sign, the guard does not fire, and the function returns the sentinel. The workaround was written for the case where the salt and the stored field are the same value. Nobody had arranged for them to differ.
Why 257 bytes, and why twice
Two length limits define the window. sshd refuses anything over 1024 bytes at the protocol layer, MAX_PASSWORD_LEN. musl refuses to hash anything over 256. So 256 bytes gets hashed normally and fails, while 257 bytes is long enough to defeat the library and short enough to still be accepted by the daemon. Everything from 257 to 1024 is inside the window. Independent reproductions settled on the same brackets: 256 rejected, 257, 300 and 1023 accepted, logging in as the alpine user with uid 1000.
The second attempt requirement is stranger and less well documented. Across the reproductions, the first password on a connection fails and the second one succeeds. The patch says why, indirectly: it adds a heap copy of the shadow field before calling crypt(). That change is a fix for a buffer lifetime problem, not a policy change. On the first attempt, crypt() writes into a buffer that the stored field pointer already points at, so the comparison happens against something that is no longer the shadow value. On the second attempt, the credential has been cached and the comparison lines up.
This part is inference from the diff, not a statement in any commit message. It fits the observed behaviour, and it explains a detail that would otherwise look like folklore.
The fix is four characters
The patch rejects any stored field shorter than four characters. * is one character. ! is one character. A truncated hash is short. A real hash is not. The check costs nothing, needs no knowledge of which C library is linked, and closes the path regardless of what crypt() decides to return.
OpenSSH shipped it as 10.6p2 on 2026-11-05. Alpine published an advisory the same day and backported the fix across every supported branch: 3.16, 3.17, 3.18, 3.19, 3.20, 3.21, 3.22, 3.23, 3.24 and edge. The fixed versions run from 10.6_p2-r0 on edge down to 9.0_p1-r6 on 3.16.
The advisory bolds one line, and it is the line that decides whether a fleet is actually patched: updating the package is not enough, because the daemon has to be restarted. A running sshd holds the vulnerable code in memory. The binary on disk can be new while the process that accepts connections is old, and that state persists until someone restarts the service or reboots the host.
Who was actually exposed
The viral version of this story said any Alpine SSH server accepts any password. That is not what the bug does, and the gap matters more than the headline.
The target account's shadow field has to be exactly *. Not !, not a real hash. This is the condition that broke most of the failed reproductions, including attempts against the root account in the official Alpine Docker image, where the field is !.
The distinction is not cosmetic. passwd -l writes !. In 2019, as the fix for CVE-2019-5021, the finding that Docker images shipped with no root password, Alpine locked root with !. Then in 2022, Alpine 3.16 switched root to * so that key-based logins work without PAM. That change was deliberate and it moved a class of accounts into the vulnerable shape.
So the affected population is accounts whose field is *: key-only users, accounts backed by LDAP or nscd where the local field is a placeholder, the alpine user in tiny-cloud images, and root on any host that set PermitRootLogin yes.
Root is not reachable by default, because PermitRootLogin prohibit-password is the shipped default and it rejects password authentication for root regardless of what the shadow field holds. The real escalation paths are duller. tiny-cloud images from 3.18.11 to 3.24.3 ship an alpine user with passwordless doas, so a login as that user becomes root. Any other * account with sudo or doas rights does the same. A host that changed PermitRootLogin to yes is directly reachable.
The other half of the conjunction is a $5$ or $6$ hash somewhere on the machine. Without one there is no salt to borrow, pick_salt() has nothing to hand over, and the comparison never reaches the sentinel. A host with every account locked and no real passwords has no borrowable salt. That is cold comfort on a normal server, where at least one real account is the norm.
Who was never exposed
glibc is not affected, and libxcrypt, which Debian moved to, returns *0 rather than *. Two characters do not equal one, so the comparison fails the way it should.
PAM builds never reach the vulnerable call. If UsePAM yes is set, or the build links PAM, the password check goes through PAM's stack and sshd's own crypt() comparison is not the gate. This is the single most common reason a host is immune, and it is also why the same test against Debian fails.
Dropbear handles the * salt as an ordinary failure and does not collide. That matters because OpenWrt defaults to Dropbear, and the claim that OpenWrt is broadly affected is largely wrong. OpenBSD, FreeBSD and macOS builds are unaffected as well.
The numbers nobody has
What is missing from every version of this story is scale. No primary source has published a count of exposed hosts. The discoverer's writeup says the prevalence numbers and the full 17-environment test setup may be published later, and they were not in the writeup at the time of the release. There is no Censys or Shodan figure cited by Alpine, OpenSSH, or the disclosure.
In-the-wild exploitation is in the same state. Belgium's CCB attached an actively exploited label, and that label cites no primary evidence: no Alpine incident report, no OpenSSH statement, no honeypot logs. It may be right. It is not currently sourced.
The CVSS score is 8.1, high, and the vector describes a network-reachable authentication bypass, which it is. The score does not encode the account-name requirement, the borrowed-salt requirement, or the second-attempt requirement. Reading 8.1 as a prediction of how many machines fall is a misreading of what the number is for. One commenter in the disclosure thread disputed the attack complexity rating on exactly this basis.
Where this could be wrong
The mechanism above is reconstructed from source and from the patch, not from a run on a lab machine. The sentinel behaviour, the 256 byte cap, the salt borrowing and the length check are all visible in code and commits that anybody can read. The two-attempt behaviour is consistent across several independent reproductions and across the shape of the xstrdup change, but no commit message states the buffer-lifetime explanation in those words. If the real cause of the first-attempt failure is something else, the observable rule still holds and the explanation does not.
The CVE record itself was not read from NVD: the page returned nothing. The 8.1 score and the assignment date therefore come from secondary sources that agree with each other. They are probably right. They are not primary.
A bcrypt corner case was reported by one vendor, suggesting a related short-hash path survived in 10.6p2 and was blocked by the new length check rather than removed. That has no confirmation in the OpenSSH notes, and the same vendor's test says the length check blocks it. Treat it as open.
The affected-population reasoning depends on shipped defaults, and defaults move. The 2022 change that put * in root's field on Alpine widened this bug's reach two years before anyone found it. The package versions quoted here describe the day of the release, not a permanent state of the ecosystem.
Finally, the community record is thin in one direction. The discussion that can be read is on Hacker News, where the item drew 2,993 points and 749 comments, and the corrections about !-locked accounts came from users testing it themselves. Reddit search returned 403 and X was not checked. The corrections that survived are the ones that were reproducible, which is the only filter worth trusting, but that is not the same as a full survey of what practitioners found.
On this page
Sources
- sshole: OpenSSH password authentication bypassÖzgün Kültekin, 2026
- OpenSSH password authentication bypass advisoryAlpine Linux, 2026
- OpenSSH release notes, 10.6p2OpenSSH, 2026
- avoid password authn bypassDamien Miller, 2026
- sshole proof of concept and checkeroz9un, 2026
- musl crypt_sha512.cmusl libc, 2026
- musl crypt_des.cmusl libc, 2026
- make crypt return an unmatchable hash rather than NULL on failuremusl libc, 2012
- crypt: add sha256 and sha512 supportmusl libc, 2012
- Determine appropriate salt for invalid usersOpenSSH, 2016
- OpenSSH commit, bcrypt salt handlingOpenSSH, 2026
- sshole discussion threadHacker News, 2026
Frequently asked questions
Does this affect every Alpine server with SSH open?
No. The build has to use musl without PAM, password authentication has to be enabled, the target account has to carry exactly * in its shadow field, and some other account on the machine has to hold a $5$ or $6$ hash. Alpine images do ship several of those conditions by default, which is why the advisory is urgent for them, but a PAM build or a host with no real hashes anywhere never reaches the vulnerable comparison.
Why does the exploit need two attempts and a long password?
The long password is what pushes musl past its 256 byte key cap, which is where the library stops hashing and returns * instead. The second attempt is what lines the stored field up with the sentinel: the patch heap copies the shadow value before calling crypt(), which points at a buffer lifetime problem on the first attempt.
Is root reachable with this?
Not by default. Alpine base images have shipped a root account with a * field since 3.16, but the default PermitRootLogin prohibit-password rejects password logins to root. The realistic paths are a non-root * account that can escalate through sudo or doas, or a host that changed PermitRootLogin to yes.
Does restarting sshd matter?
Yes. The Alpine advisory calls this out directly: the upgraded package replaces the binary on disk, but the daemon already running in memory continues to serve the vulnerable code until it is restarted.
Should the CVSS score of 8.1 be read as a severity forecast?
Treat it as a network auth bypass score, not a prediction of how many machines fall. The practical requirements, an account name, a salted hash elsewhere on the host and a second attempt, are not in the number.