Alpine Linux 安全团队披露了 openssh-server 包中存在的严重身份验证绕过漏洞,攻击者可在不知晓密码的情况下通过发送超长密码登录系统 2。该问题影响未启用 PAM 的 sshd 构建版本,在特定条件下允许远程用户绕过认证机制 12。受影响范围涵盖 Alpine 3.16 至 3.24 及 edge 分支,其中从 3.18.11 到 3.24.3 发布的 tiny-cloud 镜像因默认包含密码字段为 * 的 alpine 用户而面临较高风险 2。修复措施包括升级 openssh 软件包并重启服务,或直接在配置中禁用密码认证(设置 PasswordAuthentication no) 2。值得注意的是,使用 openssh-server-pam 且配置 UsePAM yes 的系统不受此漏洞影响,但无 PAM 支持或配置 UsePAM no 的环境则存在隐患 2。
这一长期潜伏的逻辑缺陷根源在于 musl libc 与 OpenSSH 交互中的错误处理机制 1。自 1980 年起,Unix 系统中 * 字符被用作 daemon 账户无法匹配的密码哈希标志 1。2012 年 8 月,musl libc 修改 crypt() 函数以兼容旧程序,并在随后限制 sha512crypt 密码长度为 256 字节,超过该长度的输入会被视为失败并返回 * 1。尽管 CVE-2016-6210 曾针对计时侧信道攻击对 OpenSSH 进行修复,统一了对无效用户的哈希计算耗时,但未正确排除 * 返回值的情况 1。在无 PAM 环境下,当账户密码字段为 * 且系统中存在至少一个拥有 $5$ 或 $6$ 哈希值的账户时,输入长度介于 257 至 1024 字节的密码会导致 crypt() 返回 *,从而被 SSHD 误判为有效凭证 2。
研究者 Özgün Kültekin 报告了这一漏洞,OpenSSH 项目的 Damien Miller 和 Darren Tucker 以及 Alpine Linux 的 Timo Teräs、Natanael Copa 参与了修复工作 2。漏洞的发现得益于自动化测试手段,2026 年 11 月,研究人员利用 Agent Swarms 对多种构建变体进行了 17,600 次异常登录测试,最终确认仅在基于 musl 且无 PAM 的环境中可复现该问题 1。相关代码变更可追溯至 2012 年的两个关键提交:musl commit b3c4cc12(2012 年 8 月)和 musl commit 88bf5a8a(2012 年 8 月 29 日) 1。
Alpine Linux has issued a security advisory regarding a critical authentication bypass vulnerability in its openssh-server package, which allows attackers to log in without knowing the password 2. The flaw stems from a long-standing logic error in the interaction between OpenSSH and the musl libc library, specifically affecting systems configured without PAM support 12. This issue has persisted for approximately ten years, dating back to changes introduced in 2012, but was recently identified through automated testing 1.
The root cause involves how musl libc handles encryption failures. In August 2012, musl modified its crypt() function to return '?' instead of NULL on failure to maintain compatibility with legacy programs 1. Three weeks later, on August 29, 2012, musl further restricted SHA-512 crypt password lengths to 256 bytes; passwords exceeding this limit are treated as failures and result in the function returning an asterisk ('*') 1. Historically, Bill Joy used '*' in Unix daemon accounts in 1980 as a flag for a password hash that could never match, effectively disabling login for those accounts 1. However, certain configurations of the SSH daemon fail to properly handle this return value. When an attacker submits a password longer than 256 bytes (specifically between 257 and 1024 bytes), crypt() returns '*', which the SSHD mistakenly interprets as a valid credential match against accounts with disabled or empty passwords 12. This vulnerability is particularly relevant in environments where at least one account exists with $5$ or $6$ hash values 2.
The exposure of this bug was facilitated by a previous security fix. CVE-2016-6210 addressed a timing side-channel attack in OpenSSH by ensuring that invalid users also underwent hash computation to normalize response times, but the patch did not correctly exclude the special case of the '*' return value 1. Researchers confirmed the exploit’s reproducibility in November 2026 by conducting 17,600 anomalous login tests using Agent Swarms across various build variants, verifying that the bypass only works in musl-based environments lacking PAM 1. Key code commits responsible for the behavior include musl commit b3c4cc12 from August 2012 and 88bf5a8a from August 29, 2012 1.
Affected Versions and Mitigation Strategies
The vulnerability impacts multiple releases of Alpine Linux, including versions 3.16 through 3.20, 3.21 through 3.24, and the edge branch 2. It specifically affects openssh-server builds compiled without PAM, or instances of openssh-server-pam configured with UsePAM no 2. Conversely, systems running openssh-server-pam with UsePAM yes remain unaffected 2. Cloud images are also at risk; tiny-cloud images ranging from version 3.18.11 to 3.24.3 ship with an alpine user having a * password field, making them vulnerable targets 2.
To remediate the issue, users must upgrade their openssh packages and restart the sshd service immediately 2. Alternatively, administrators can disable password authentication entirely by setting PasswordAuthentication no in the configuration file 2. The discovery and resolution process involved collaboration among several key figures: Özgün Kültekin of Wakefield reported the issue, while Damien Miller and Darren Tucker from the OpenSSH project, along with Timo Teräs and Natanael Copa from Alpine, were acknowledged for their contributions to fixing the defect 2.
评论
还没有评论,欢迎留下第一条。