OpenSSH on musl bug: any password over 256 chars logs into root since 2016

Yamapama · x · 2026-11-05

A serious auth bug affecting musl-based Linux (Alpine, OpenWrt, Buildroot, Yocto, many Docker images) since 2016: accounts that should never accept passwords (root, key-only deploy users, LDAP users) accept any password longer than 256 characters.

The writeup traces the full causal chain: the no-login field dating to 1980 BSD; the POSIX spec saying crypt() returns NULL on failure; programs that never check NULL; and musl's 2012 change to return a single-char placeholder instead — which OpenSSH's long-password path ends up comparing successfully, letting any password through.

Affects production servers and countless container images; affected systems should upgrade and disable password auth.

Related event: OpenSSH flaw on musl-based Linux lets any 256+ character password unlock key-only accounts(7 posts)→

Original post →

More from Infra

Infra channel →