Skip to content
Access control Write-up Intermediate

Alpine Linux Security Advisory: OpenSSH-server password authentication bypass

A password authentication bypass in OpenSSH on Alpine Linux allows an attacker to log in without a password to accounts with a '*' password field, provided another account has a $5$ or $6$ hash. The attacker sends a very long password, causing musl's crypt() to return '*', which matches the stored field and grants access.

alpinelinux.org

Published on alpinelinux.org

If you cannot update yet, at least disable password logins: set PasswordAuthentication no in your sshd configuration and restart sshd. Either one closes the hole.

The author, on alpinelinux.org

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, musl's crypt() returns '*' for passwords longer than 256 bytes, and sshd compares this to the stored '*' password field of passwordless accounts, treating it as a match.

Impact

An attacker could log in as any account with a '*' password field, potentially gaining root if PermitRootLogin is yes or if the account can escalate via doas, but only when PasswordAuthentication is enabled and another account has a $5$ or $6$ hash.

What the attacker needed

Alpine openssh-server without PAM or UsePAM no; PasswordAuthentication yes; An account with '*' password field; Another account with $5$ or $6$ hash

The fix

The issue was fixed in OpenSSH 10.6p2 and in Alpine package updates; users should upgrade and restart sshd, or disable password authentication as a workaround.

How it was found

  1. Ensure the target runs Alpine's openssh-server without PAM (or with UsePAM no) and PasswordAuthentication yes.
  2. Ensure at least one account has a '*' password field and another account has a $5$ or $6$ password hash.
  3. Send a password between 257 and 1024 bytes long to the target account.
  4. The login succeeds without a valid password.

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.

This is a flaw in how the SSH server checks passwords on Alpine Linux. If an account has no password set (shown as '*' in the password file), and another account on the same machine has a normal password hash, an attacker can send a very long password. The system's password-checking function then returns '*' as an error, which accidentally matches the stored '*', so the login succeeds without a real password.

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.

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.