Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-123158 — Python proof-of-concept for CVE-2026-123158 (SSHole), an OpenSSH password authentication bypass on musl libc systems without PAM, with root cause analysis and mitigation notes. | Kitploit
工具/GitHubGitHub/k3ystr0k3r/cve-2026-123158
Vulnerability AnalysisExploitationNetwork SecurityPenetration TestingAuthenticationRemote Access Tool
GitHubk3ystr0k3r/cve-2026-123158

CVE-2026-123158

Python proof-of-concept for CVE-2026-123158 (SSHole), an OpenSSH password authentication bypass on musl libc systems without PAM, with root cause analysis and mitigation notes.

查看仓库
1天前尚未审核
分享
内容在请求的语言中不可用。显示英文版本。

CVE-2026-123158 - OpenSSH Password Authentication Bypass (SSHole)

CVE-2026-123158 | CVSS 3.1: 8.1 (High)

An authentication bypass in OpenSSH affecting Linux systems running musl libc without PAM. SSHole is a password authentication bypass affecting OpenSSH's sshd implementation on Linux systems using musl libc without PAM. The vulnerability originates from an interaction between OpenSSH's internal password verification logic and musl's crypt() implementation. When a specially sized password is processed, musl's crypt() can return the literal string * instead of a valid password hash. OpenSSH does not correctly distinguish this error result from a legitimate stored password value. For accounts whose shadow password field contains *, the comparison can consequently succeed. An unauthenticated remote attacker can exploit this behaviour to bypass SSH password authentication and gain access to affected accounts. The vulnerability is tracked as CVE-2026-123158.

Vulnerability Information

AttributeDetails
NameSSHole
CVECVE-2026-123158
ComponentOpenSSH sshd
Vulnerability TypePassword Authentication Bypass
CWECWE-394
CVSS 3.18.1 High
Attack VectorNetwork
Attack ComplexityHigh
Privileges RequiredNone
User InteractionNone
Affected PlatformLinux
C Librarymusl libc
AuthenticationInternal password authentication without PAM
Fixed Upstream VersionOpenSSH 10.6p2

CVSS Vector:

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected Configurations

The vulnerability affects OpenSSH versions before 10.6p2 when running on Linux with musl libc and without PAM.

However, the authentication bypass requires additional account and configuration conditions.

The following conditions must be satisfied:

  • OpenSSH is linked against musl libc.
  • PAM is not used for SSH password authentication.
  • PasswordAuthentication is enabled.
  • At least one local account has a shadow password field containing exactly *.
  • Another local account has a SHA-256 or SHA-512 password hash available for salt selection.
  • The SSH service is reachable by the attacker.

For root authentication, PermitRootLogin yes must also be configured.

An account containing ! in its shadow password field is not equivalent to an account containing * for this vulnerability.

Potentially affected environments

  • Alpine Linux systems running the non-PAM OpenSSH server.
  • OpenWrt systems using affected musl-based OpenSSH builds.
  • Buildroot-based Linux environments.
  • Yocto-based embedded Linux distributions.
  • Custom Linux images using musl libc and OpenSSH without PAM.

These platforms are not automatically vulnerable. Their OpenSSH build, authentication configuration and account database must satisfy the required conditions.

Generally unaffected configurations

  • OpenSSH using glibc rather than musl.
  • OpenSSH configurations using PAM for password authentication.
  • Systems with SSH password authentication disabled.
  • Systems running a patched OpenSSH build.
  • SSH implementations that do not use the affected OpenSSH authentication path.

Technical Analysis

1. Password authentication

When PAM is disabled, OpenSSH performs password verification internally.

The authentication process involves the following operations:

  1. The SSH client submits a password.
  2. sshd retrieves the target account's stored password field.
  3. OpenSSH determines which salt to use for password verification.
  4. The supplied password is passed to crypt().
  5. The resulting value is compared against the stored password field.
  6. Authentication succeeds or fails depending on the comparison.

The relevant implementation is found in:

auth-passwd.c
openbsd-compat/xcrypt.c
openbsd-compat/port-uw.c

2. Salt selection

An important part of the vulnerability is how OpenSSH handles accounts without a usable password hash.

When the target account has a short password field, OpenSSH does not use that field directly as a cryptographic salt.

Instead, the compatibility implementation can select a salt from another local account containing a valid password hash.

The relevant function is:

pick_salt()

This behaviour originated from earlier password-authentication timing protections, including work associated with CVE-2016-6210.

For SSHole, this salt-selection behaviour becomes part of the vulnerable execution path.

3. musl crypt() error handling

musl's SHA-256 and SHA-512 password hashing implementations impose a maximum password input length of 256 bytes.

When an input exceeds this limit, the hashing operation fails.

Instead of returning a valid password hash, musl's crypt() returns:

*

This value is an error marker.

It is not a valid SHA-256 or SHA-512 password hash.

However, * is also commonly used in shadow password fields to represent accounts without a usable password.

This creates the conditions for the authentication bypass.

4. The incorrect comparison

The vulnerable authentication path ultimately compares the result returned by crypt() with the stored password field.

Conceptually:

encrypted_password = xcrypt(password, salt);

return encrypted_password != NULL &&
       strcmp(encrypted_password, pw_password) == 0;

Under the vulnerable conditions:

Target account password field: *

musl crypt() result:           *

String comparison:             MATCH

The error marker is incorrectly treated as a successful password verification result.

This is the central failure behind SSHole.

The issue is not a cryptographic collision, password cracking technique or memory corruption vulnerability.

It is an authentication logic error caused by interpreting an invalid return value as a valid password hash.


Exploitation Behaviour

The documented vulnerable input range is 256–1024 characters in the CVE description. Independent reproduction has demonstrated successful authentication with inputs of 257–1024 bytes.

The upper boundary is associated with OpenSSH's password input limit.

An additional implementation detail is relevant to reproducing the vulnerability.

The two-attempt behaviour

Independent source-level reproduction identified an interaction involving pick_salt() and musl's shadow-password handling.

During the first authentication attempt:

  • OpenSSH selects a salt from another account.
  • The salt-selection routine reads shadow entries.
  • musl reuses an internal shadow-password buffer.
  • The selected hash is subsequently cleared.
  • The target account's stored password pointer can reference the same buffer.
  • The first comparison consequently fails.

The selected salt is cached by pick_salt().

On a subsequent attempt within the same SSH connection, the cached salt avoids the same shadow-entry traversal.

The target account's stored * value remains available for the comparison.


This behaviour has been reproduced in controlled environments. It should not be confused with a requirement that every vulnerable installation necessarily exhibits identical logging or client behaviour.

---

## Root Cause Summary

The vulnerability requires three interacting behaviours:

| Component | Behaviour |
|---|---|
| OpenSSH | Selects an alternative salt when the target account has no usable hash |
| musl libc | Returns `*` when the supported password hashing operation fails |
| Shadow password database | Can contain `*` as an account's password field |

Individually, these behaviours have legitimate purposes.

The vulnerability emerges when their interaction allows an error marker to satisfy the password comparison.

---

## Proof of Concept

This repository contains a Python proof of concept for CVE-2026-123158.

```text
.
└── exploit.py

The script is intended for controlled vulnerability verification against authorized SSH services.

Requirements

下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    ghostlock-app

    yukonga/ghostlock-app

    针对 CVE-2026-43499 的一键式 Android 内核漏洞利用应用,通过内核模块加载实现权限提升,并提供偏移提取与设备端分析工具。

    961
  • 2

    wifit3

    derv82/wifit3

    Wifite 但仅限 USB 且跨平台。

    755
  • 3

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    625
  • 4

    jumpserver

    jumpserver/jumpserver

    JumpServer是一个开源的特权访问管理(PAM)平台,为DevOps和IT团队提供通过Web浏览器按需安全访问SSH、RDP、Kubernetes、数据库和RemoteApp端点的能力。

    501
  • 5

    SafeLine

    chaitin/safeline

    自托管WAF和反向代理,可过滤恶意HTTP流量、阻止SQL注入、XSS和机器人攻击,具备速率限制和动态HTML/JS加密功能。

    456
  • 6

    mcp-reverse

    1llu50ry/mcp-reverse

    MCP 服务器,提供 180 多个逆向工程工具,聚合了 Ghidra、IDA、x64dbg、Frida 以及其他 56 个后端,并内置原生二进制解析器和包含 4,200 项技能的知识库。

    344

探索所有工具

浏览我们的工具集合

查看所有工具 →