# SSH situation is insane

Source: https://www.youtube.com/watch?v=ErB1SRcksDc
Recap page: https://rapidrecap.app/video/ErB1SRcksDc
Generated: 2026-11-10T20:10:27.425+00:00

---
## The Gist

A critical OpenSSH flaw in Alpine Linux allows root access by inputting passwords longer than 256 characters, exploiting a historical hash comparison error.

## Quick Overview

Alpine Linux and musl libc contain a severe SSH vulnerability where supplying a password over 256 characters tricks the system into comparing error returns against invalid credentials. Ozgun Kultekin discovered this vulnerability, which affects default Alpine Docker images lacking PAM and utilizing traditional password authentication. Emergency fixes have been issued for OpenSSH and musl libc, but the underlying issue stems from a coding practice introduced in 1980.

**Key Points:**
- Ozgun Kultekin discovered the vulnerability, which is tracked on sshhole.com and affects specific Linux distributions using musl libc.
- The vulnerability allows unauthorized root access if a password exceeds 256 characters on vulnerable systems.
- The core issue stems from the crypt_sha512 implementation in musl libc returning the star character instead of null upon a cryptographic failure.
- Systems using glibc are unaffected by this bug because glibc handles password hashing and error conditions differently.
- Alpine Linux Docker images are particularly vulnerable because they ship with password logins enabled and PAM disabled by default.
- The flaw allows an attacker to bypass authentication by providing a long password when targeting an account that lacks a password while another account has a valid password hash.
- This behavior traces back to a 1980 Unix decision by Bill Joy where the star character was used to denote accounts without valid passwords.

![Screenshot at 08:48: A breakdown of the different build combinations showing that only musl libc builds without PAM or shadow files are vulnerable to the exploit.](https://ss.rapidrecap.app/screens/ErB1SRcksDc/00-08-48.jpg)

**Context:** Secure Shell (SSH) is a standard protocol used for secure remote login and other network services on Unix based operating systems. Musl libc is a lightweight alternative to the standard GNU C Library, commonly found in containerized environments like Alpine Linux.

## Detailed Analysis

The vulnerability relies on a cascading failure involving password length limits and error handling in the musl libc cryptography library. When a user attempts to log in via SSH, the system runs a hash check against the shadow file. If the input exceeds the 256 character key maximum specified by KEY_MAX, the crypt_sha512 function returns zero. Because older implementations returned null for errors, but musl libc was modified to return a star character, the system mistakenly compares the error symbol against stored password hashes. When an account with a star password exists alongside an account with a real password, supplying a long string forces a successful match due to this flawed comparison logic.

### The Mechanics of the Musl Libc Flaw

The vulnerability exploits a mismatch between cryptographic return values and error handling in musl libc.

- The crypt_sha512 function in musl libc enforces a maximum key length of 256 characters.
- When inputs exceed 256 characters, the function triggers an error and returns the star character instead of null.
- This star character matches the historical convention used in Unix shadow files to indicate accounts without passwords.

![Screenshot at 08:19: The source code view of crypt\_sha512 showing the exact line where the key length exceeding KEY\_MAX returns an error value.](https://ss.rapidrecap.app/screens/ErB1SRcksDc/00-08-19.jpg)

### Exploiting the Timing and Password Check

Attackers can leverage timing discrepancies and specific account configurations to bypass authentication.

- SSH password checks normally compare input hashes against stored credentials in the system shadow file.
- By providing a password longer than 256 characters, the cryptographic function fails and returns a star character.
- If a target account uses a star as its password placeholder and another account uses a standard hash, the comparison succeeds and grants access.

![Screenshot at 08:26: The terminal output showing the comparison between the computed hash and the shadow file entry during a login attempt.](https://ss.rapidrecap.app/screens/ErB1SRcksDc/00-08-26.jpg)

### Affected Distributions and Prerequisites

Not all Linux systems are vulnerable, as specific pre-conditions must be met for the exploit to succeed.

- Distributions running the standard glibc library, such as Ubuntu and Debian, are completely immune to this flaw.
- Vulnerable systems must run musl libc without PAM modules enabled and with password logins turned on by default.
- Alpine Linux Docker images meet all preconditions out of the box, making millions of containerized deployments vulnerable.

![Screenshot at 09:03: A grid matrix comparing glibc and musl builds across different PAM and shadow configurations to isolate the vulnerability.](https://ss.rapidrecap.app/screens/ErB1SRcksDc/00-09-03.jpg)

