Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
felixsama969
V2EX  ›  Linux

OpenSSH 严重问题,输入 257 个 A 即可登录 root

  •  2
     
  •   felixsama969 · 19h 22m ago · 3705 views
    影响范围:基于 musl libc 的环境(alpine,openwrt)

    AWS/Azure 的 alpine 镜像默认密码是 `*`

    musl:自 2012 年起,其 `crypt()` 函数在执行失败时(输入超过 256 个字符)会返回 `*`,而非 `NULL`。由于 `sshd` 的检查逻辑未考虑到这一点,导致哈希计算失败的结果可能会与已锁定账户中的 `*` 字段相匹配。

    升级到 OpenSSH 10.6p2 或更高版本是安全的
    16 replies  •  2026-11-06 15:55:27 +08:00
    Overfill3641
    Overfill3641
    19h 18m ago
    1
    本来想试下的,结果忘记设置的是纯密钥登录。😅
    Lukedis
    Lukedis
    18h 22m ago
    2
    @Overfill3641 刚查了 ChatGPT ,某些原本通过密码字段锁定、预期只能使用密钥登录的账户,也可能受到影响
    anonymity
    anonymity
    18h 1m ago
    3
    openwrt 默认是 dropbear 影响不大
    nullref
    nullref
    17h 33m ago via Android
    4
    ssh 都用完即关
    taikobo
    taikobo
    17h 6m ago
    5
    亲测 openwrt 不受影响
    ashong
    ashong
    11h 43m ago
    6
    alpine + OpenSSH_9.3p2 无法复现
    liuzimin
    liuzimin
    10h 31m ago via Android
    7
    有两步验证的应该不受影响吧。
    anytk
    anytk
    10h 2m ago
    8
    嵌入式 alpine 大多会考虑 dropbear
    thereone
    thereone
    9h 33m ago
    9
    这个是针对 root 默认密码是*这个的才有影响吧,手动装的 alpine 测试无法复现 openssh-10.2_p1-r0 版本。
    chinni
    chinni
    9h 17m ago
    10
    看了下家里局域网的 alpine 3.20 ,openssh-server-9.7_p1-r5 x86_64 {openssh} (SSH-OpenSSH) [installed]

    开了密码登录输入很长的密码 无法复现的。
    CatCode
    CatCode
    9h 9m ago
    11
    @ashong 应该是已经发了修复了 alpine 不好装老版本的包
    fiveStarLaoliang
    12
    用 glic 的 ssh 不受影响
    zhiwei3306
    zhiwei3306
    8h 36m ago
    13
    没理解这 bug ,都知道密码是*号了,还要输 257 个 A 干嘛?
    tcpzhang
    tcpzhang
    8h 31m ago❤️1
    14
    @zhiwei3306 “AWS/Azure 的 alpine 镜像默认密码是 `*`”这个描述不对,不是默认密码为"*",shadow 文件是存哈希过的密码,而 root 用户存的是“*”(代表禁止密码登录)。结果遇上 crypt()函数这个低级错误。
    Autonomous
    Autonomous
    7h 10m ago
    15
    PermitRootLogin prohibit-password
    PasswordAuthentication no
    PermitEmptyPasswords no
    ChallengeResponseAuthentication no
    PubkeyAuthentication yes
    UsePAM yes
    amorphobia
    amorphobia
    2h 38m ago
    16
    musl libc 不遵守 POSIX 规范返回了字符串 "*",还在邮件列表里甩锅说完全是 OpenSSH 的问题……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2944 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 10:34 · PVG 18:34 · LAX 02:34 · JFK 05:34
    ♥ Do have faith in what you're doing.