A recently disclosed Linux login bug could let attackers into some servers without the right password. No lock was picked: two unrelated "this isn't a real password" signals happened to look identical, and the login check treated them as a match. The bug matters less than the question that would have caught it before it shipped.

If you ask an AI tool to review code before you merge it, this post gives you one specific question to add. It catches a whole family of bugs that a plain "check this for security issues" request walks straight past.

What actually broke, in plain terms

OpenSSH is the software most Linux servers use for remote logins. When you log in with a password, the server scrambles what you typed into a hash (a fingerprint of the password that can't be turned back into the password) and compares it with the fingerprint stored for your account.

On systems built on musl, the basic toolbox of functions that Alpine Linux and a few other distributions rely on, the scrambling function crypt() has a quirk. For the two common modern hash types (SHA256 and SHA512 based), it refuses passwords longer than 256 bytes. When it refuses, it doesn't raise an error. It returns a single asterisk: *.

Here is the problem. Accounts that aren't supposed to accept passwords at all (locked accounts, disabled accounts, service placeholders) also store an asterisk in the password field. And since a 2016 fix for a different bug (attackers telling real usernames from fake ones by how long a login attempt took), OpenSSH hashes the typed password even for these accounts, borrowing the salt of another account on the machine that has a real password. So:

  1. An attacker sends a password longer than 256 bytes for a locked account whose name they know.
  2. OpenSSH hashes it with the borrowed salt, crypt() refuses and returns *.
  3. OpenSSH compares that * with the stored *.
  4. They match. Login succeeds.

Two "no real password here" markers got compared as if one of them were real data, and a fix for one security bug opened the path for the next. BleepingComputer has the clearest technical walkthrough.

One more honest detail: the OpenSSH maintainers say the root cause sits outside their code, in musl. Their patch rejects a match when the stored password field is shorter than four characters. According to The Hacker News, they describe it as a workaround, not a fix for the underlying ambiguity.

Why this is a pattern, not a musl quirk

Strip away the C code and the Linux details and the bug has a simple shape: a function returns a fixed value when it fails, and that value happens to equal a legitimate "nothing set here" placeholder somewhere else. Programmers call these placeholder values sentinels. When two sentinels meet in a comparison, you get a match that means nothing.

This shape is not tied to any language. Here it is in a few lines of Python:

The same bug, no C or SSH required
import hashlib

LOCKED = "*"  # stored for accounts that must not log in with a password

def hash_password(pw: str) -> str:
    if len(pw) > 256:
        return "*"  # "error" marker, looks harmless on its own
    return hashlib.sha256(pw.encode()).hexdigest()

USERS = {
    "alice": hash_password("correct horse"),
    "backup": LOCKED,
}

def check_login(user: str, pw: str) -> bool:
    return hash_password(pw) == USERS[user]

print(check_login("backup", "wrong"))    # False
print(check_login("backup", "x" * 300))  # True: locked account opens

Read each function alone and nothing looks wrong. No overflow, no injection, no unescaped input. The danger only exists in the relationship between two places: what hash_password returns on failure, and what USERS uses to mean "no password." That's exactly why a generic review request tends to miss it. There's no single suspicious line to point at.

The real bug existed since 2016. Security researcher Ozgun Kültekin found it by running AI agents through roughly 17,600 automated login tests. That's being reported as a win for AI security research, and it is one. It's also the expensive, after the fact way to find something a short, targeted question could flag at review time.

The prompt that catches it before merge

The fix is to stop asking the reviewer "is this secure?" and start asking it to trace failure values. Paste this into whatever AI tool you use for code review, along with the diff:

Try this prompt
Review this diff for authentication and authorization logic.

For every comparison that decides whether access is granted
(password checks, token checks, role checks, ownership checks):

1. List both sides of the comparison.
2. For each side, list every value it can take when something
   fails or is missing: error returns, defaults, empty strings,
   None/null, placeholder markers like "*" or "!", zero.
3. Say whether any failure value on one side could equal any
   failure or placeholder value on the other side.
4. Check what happens with extreme input lengths: empty,
   very long, longer than any documented limit.

If two "not a real value" signals can match, flag it as a
likely authentication bypass and show the input that triggers it.
Ignore style issues.

The difference shows up in what comes back. Here's an illustrative sketch of how each answer tends to look for the Python snippet above:

Illustrative answers: generic prompt vs targeted prompt
PROMPT: "Review this code for security issues."
ANSWER (sketch):
  Consider using bcrypt or argon2 instead of SHA256.
  Add a salt. Use a constant time comparison.
  Handle KeyError for unknown users.

PROMPT: the targeted prompt above
ANSWER (sketch):
  check_login compares hash_password(pw) with USERS[user].
  hash_password returns "*" when len(pw) > 256.
  USERS stores "*" for locked accounts.
  A 257+ character password for "backup" makes both sides "*".
  Result: locked account accepts any long password. Bypass.

The generic answer isn't wrong. Those are real improvements. It just never reaches the bug, because nothing told it to look at what each side becomes when things go wrong. The targeted prompt forces exactly that trace.

Patching Alpine fixes one bug, while one question about failure values catches the whole class wherever it shows up next. Before your next pull request that touches login or permissions, paste the prompt above into your reviewer and read what it says about every comparison that grants access.