In the Hole

The "asshole" security vulnerability allows login to passwordless Linux accounts by using a password over 256 characters. This critical flaw impacts various Linux distributions, especially those using musl libc, which are common in containers. The root cause lies in how the standard C library function "crypt" handles invalid input. In glibc, providing a bad input to "crypt" returns NULL, requiring callers to handle this error. However, musl libc, designed for both lightweight and server environments, returns an asterisk "" for invalid inputs instead of NULL. This deviation was chosen to avoid common NULL pointer dereference crashes. The critical problem arises because the "" character is also used in /etc/shadow or /etc/passwd files to designate accounts with no password. Consequently, when an attacker provides a password longer than 256 characters, musl's "crypt" implementation returns "". OpenSSH then compares this returned "" with the account's stored password (also "*"), resulting in a successful malicious login. This vulnerability is being actively exploited, particularly in containerized environments. Ultimately, the bug is another example of issues surrounding null handling, exacerbated by AI-driven bug discovery.