Osegi
Security·2 min read

OpenSSH flaw let 257-character passwords unlock Linux accounts

A decade-old bug dubbed *sshole let any password of 257 to 1,024 characters open locked accounts over OpenSSH on musl-based Linux systems. OpenSSH 10.6p2 fixes it.

Terminal window showing an SSH login prompt on a Linux server with a very long password being typed.
Image: Numerama

A flaw that went unnoticed for more than ten years allowed attackers to log in to locked accounts over OpenSSH using any password between 257 and 1,024 characters long. The bug, nicknamed "*sshole", affects some Linux systems built on the musl library, such as Alpine Linux. OpenSSH 10.6p2, released on 5 November, fixes it.

The flaw was disclosed in early November by Ozgun Kultekin, a researcher at Wakefield. He says he compiled OpenSSH in twelve different ways and ran about 17,600 unusual login attempts, generated by AI agents, against each build. Only one configuration behaved differently from the rest.

How an asterisk became the key

Servers do not compare passwords directly. They run the password through a mathematical function and compare the result with a stored value. For accounts that must never accept a password, such as root on many systems, Unix convention since 1980 is to store a single asterisk, which no calculation can produce.

In 2012, musl made its hashing function return an asterisk on failure, and it fails whenever a password exceeds 256 characters. Then in 2016, OpenSSH fixed a timing leak that revealed which accounts existed. To equalise response times, it began running the calculation even for locked accounts. A long password therefore produced an asterisk, which matched the asterisk stored for the locked account, and the login was accepted.

Who is exposed

Several conditions must all be met: the server relies on musl (as Alpine, OpenWrt, Buildroot and Yocto do), it does not use PAM, password authentication is enabled (OpenSSH's default), and there is a locked account with an asterisk plus another with a real password. Since Alpine 3.16 in 2022, root is locked exactly this way. On official Alpine images for AWS and Azure, the default account can also gain administrator rights without a password.

Debian, Ubuntu, Fedora and other PAM-based systems are not affected. The researcher says he knows of no active exploitation.

Administrators should install OpenSSH 10.6p2 or, failing that, disable password login.

Apps worth a look

SUMO: the number puzzle

Tap the right tiles, add them up, hit the target. Easy to learn, hard to master. Free, for all ages.

Tags:opensshlinuxmuslalpine linuxvulnerabilitysshole

More from this day

See all →

More in: Security

See all →