Skip to content
Access control Write-up Advanced

I rebuilt the comparison instead of trusting the writeups

A password authentication bypass existed in OpenSSH when built with musl libc and without PAM: a stored password field of exactly '*' could be matched by a long password because musl's crypt() returns '*' on failure and sshd's fallback salt borrowing produced a failing hash equal to the stored sentinel. An attacker could log in as such an account, potentially gaining root on affected Alpine systems.

Raj Namdev Follow

Published on medium.com

The writeups disagree on details, so I built the thing. I compiled musl 1.2.5 from source with gcc 15.2, wrote a probe that contains sshd 10.6p1’s sysauthpasswd() logic and the 10.6p2 version side by side, and built it twice: once static against musl's own libcrypt.a, once against the host's glibc 2.43 and libxcrypt…

Raj Namdev, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the root cause is that musl's crypt() returns the literal string '*' on failure, and sshd's password comparison did not reject the '*' sentinel before calling crypt(), so a failure token could equal the stored password field.

Impact

An attacker could bypass password authentication on affected musl-based, non-PAM OpenSSH installations and potentially gain root; the text notes the bug is narrow because most systems use glibc or PAM.

What the attacker needed

Musl libc; sshd built without PAM; PasswordAuthentication enabled; target account password field is exactly '*'

The fix

OpenSSH 10.6p2 added a minimum password hash length check so the '*' sentinel is rejected before crypt() is called; the text also recommends disabling password authentication.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Some Linux systems store a special marker '*' in the password file to mean 'no password can ever log in here'. OpenSSH, the program that handles SSH logins, compared the result of a password check against that marker. On one particular C library (musl), a very long password made the check fail in a way that produced the same '*' marker, so the comparison wrongly succeeded and let the attacker in.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Raj Namdev

View all

9 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.