CVE-2026-123158: OpenSSH and Musl Vulnerability Under Attack

Active in-the-wild exploitation of CVE-2026-123158 allows unauthenticated attackers to gain root access on Linux systems running OpenSSH with musl libc by sending oversized passwords.

TL;DR

  • Vulnerability: CVE-2026-123158 (informally dubbed *sshole) is an authentication bypass vulnerability in OpenSSH running on systems using the musl C standard library.
  • Root Cause: Submitting a password exceeding 256 characters triggers an error condition in musl’s hashing implementation, returning an asterisk ("*"). OpenSSH misinterprets this error string as a match against shadow file entries locked with an asterisk flag.
  • Prerequisites: OpenSSH compiled or configured without Pluggable Authentication Modules (PAM), at least one account with a SHA256/SHA512 password hash present on the system, and an account disabled with an asterisk in /etc/shadow.
  • Active Exploitation: Observed in the wild by GreyNoise, watchTowr, and Previdian. Threat actor group GT10 is actively deploying an AI-assisted Python backdoor named TAC Agent alongside cryptomining payloads.
  • Immediate Remediation: Apply upstream OpenSSH patches, replace single-asterisk status fields in /etc/shadow, enable PAM where supported, and audit minimal Linux installations (such as Alpine Linux) for unauthorized package installations.

A critical logic flaw tracked as CVE-2026-123158 (informally designated *sshole) allows unauthenticated remote attackers to gain administrative shell access to targeted Linux systems within seconds. The vulnerability arises from a severe architectural interaction flaw between the OpenSSH daemon (sshd) and the lightweight musl standard C library (musl libc). When an attacker submits an oversized password payload to an affected SSH endpoint, the underlying password hashing function fails and returns a static status string. OpenSSH subsequently evaluates this return value against account privilege markers stored in the system shadow database, resulting in an immediate authentication bypass.

According to research published by Ars Technica · Security, security monitoring organisations including GreyNoise, watchTowr, and Previdian have detected widespread, automated exploitation attempts in the wild. Attackers are actively leveraging the flaw to compromise lightweight host deployments, expand botnet networks, and execute unauthorized cryptocurrency miners. Telemetry indicates that threat groups can scan, evaluate, and breach vulnerable SSH endpoints across public IP spaces in seconds, making immediate defensive remediation critical for engineering teams running alternative C library stacks.

This technical analysis details the memory and string evaluation mechanics underlying cve-2026-123158 openssh musl, outlines the precise environmental conditions required for successful exploitation, examines observed post-exploitation forensic artifacts including the TAC Agent backdoor, and provides practical diagnostic scripts and mitigation workflows for systems engineers and platform teams.

Anatomy of CVE-2026-123158: OpenSSH and Musl String Collisions

To understand CVE-2026-123158, security architects must examine how Linux authentication components delegate responsibilities between daemon code, standard system C libraries, and system database files. OpenSSH relies on POSIX-compliant library functions such as crypt() or crypt_r() to process user-supplied credentials against stored cryptographic hashes. In mainstream Linux distributions such as Red Hat Enterprise Linux, Debian, or Ubuntu, the GNU C Library (glibc) provides this capability. However, resource-constrained environments—most notably Alpine Linux, embedded networking operating systems, and minimal container base images—frequently replace glibc with musl libc to minimize binary sizes and memory footprints.

The flaw manifests at the boundary where OpenSSH interprets return codes from musl’s cryptographic routines without Pluggable Authentication Modules (PAM) handling the evaluation pipeline. Under standard operation, when a user attempts password authentication over SSH, sshd reads the target account’s entry from /etc/shadow, passes the supplied plain-text password and stored salt to crypt(), and compares the resulting string to the shadow entry. If the two strings match character-for-character, authentication succeeds.

+-----------------------------------------------------------------------------------+
|                            OpenSSH / musl Logic Collapse                          |
+-----------------------------------------------------------------------------------+
|                                                                                   |
|  1. Attacker sends password string > 256 bytes                                    |
|     +-------------------------------------------------------------+               |
|     | "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA..."    |               |
|     +-------------------------------------------------------------+               |
|                                    |                                              |
|                                    v                                              |
|  2. musl crypt_r() internal buffer length check fails                             |
|     +-------------------------------------------------------------+               |
|     | Internal Error Triggered -- Returns error string: "*"       |               |
|     +-------------------------------------------------------------+               |
|                                    |                                              |
|                                    v                                              |
|  3. OpenSSH compares returned "*" against /etc/shadow string                      |
|     +-------------------------------------------------------------+               |
|     | Stored account status in /etc/shadow: "*" (Disabled Account) |               |
|     +-------------------------------------------------------------+               |
|                                    |                                              |
|                                    v                                              |
|  4. strcmp("*", "*") == 0  ===>  AUTHENTICATION GRANTED                            |
|                                                                                   |
+-----------------------------------------------------------------------------------+

Public disclosure of the vulnerability triggered immediate, high-volume automated scanning across internet-facing IP blocks. Threat actors recognized that because lightweight container infrastructure and edge appliances frequently ship with default non-PAM OpenSSH builds running on musl, millions of exposed endpoints could be targeted without needing customized exploit primitives for specific kernel versions or CPU architectures. The vulnerability represents a severe logic failure where two defensively intended design choices—returning a safe error indicator and blocking disabled accounts—combine to completely collapse authentication controls.

Technical Root Cause: Oversized Passwords and Shadow File Parsing

The mechanics of the bypass center on how musl handles buffer limits inside its password hashing subsystem and how OpenSSH handles account state flags. Within musl’s implementation of crypt() and crypt_r(), the library enforces an input boundary on plain-text password lengths. If an application passes a password string exceeding 256 characters, musl aborts the cryptographic hashing operation. Instead of returning a NULL pointer or setting a explicit system error code (errno) that the calling application checks, musl returns a fixed string consisting of a single asterisk: "*".

In standard Unix and Linux shadow file syntax, an asterisk in the second field of an entry in /etc/shadow signifies that the account does not have a valid password set, effectively locking or disabling interactive password authentication for that user. Consider the following standard /etc/shadow layout:

root:$6$rounds=5000$saltstring$hashedpasswordvalue...:19800:0:99999:7:::
daemon:*:19800:0:99999:7:::
bin:*:19800:0:99999:7:::
service_account:*:19800:0:99999:7:::

When OpenSSH operates in a build configuration without PAM support, it performs password verification internally by opening /etc/shadow, reading the stored string for the specified account, and executing a direct string comparison against the output of the hashing library function:

# Generic conceptual logic executed inside non-PAM OpenSSH authentication loop
hashed_input = crypt(supplied_password, stored_shadow_hash);
if (strcmp(hashed_input, stored_shadow_hash) == 0) {
    // Access Granted
}

When an attacker targets a disabled account (such as daemon, bin, or a custom service_account containing an asterisk in /etc/shadow) and supplies a password payload longer than 256 characters, the execution flow degrades into an unintended string collision:

  1. The attacker initiates an SSH session specifying a username whose shadow entry contains *.
  2. The attacker transmits a password payload consisting of 257 or more characters.
  3. OpenSSH passes the 257-character string to musl’s crypt() interface.
  4. musl hits its internal input limit, halts computation, and returns the fallback error string "*".
  5. OpenSSH compares the returned string "*" with the stored shadow password field "*".
  6. The string comparison returns equality (strcmp evaluates to zero), causing OpenSSH to grant interactive shell access.

Red Hat evaluated the core condition as a fatal misinterpretation of whether a character string represents a valid cryptographic digest or an account operational flag. Because musl returned a valid string literal rather than a failure state, OpenSSH safely assumed the hash calculation completed normally and validated the matching character sequence.

Environmental Requirements and Vulnerable Configurations

CVE-2026-123158 is not universally exploitable across every Linux installation. Exploitation requires a specific confluence of operating system libraries, compilation options, and system account configurations. All four of the following prerequisites must be met simultaneously on the target host:

Vulnerability Prerequisite Matrix

A system is vulnerable to remote unauthenticated access via CVE-2026-123158 if and only if all four conditions are true:
1. OpenSSH daemon is running on top of musl libc.
2. OpenSSH is compiled or configured without Pluggable Authentication Modules (PAM) support.
3. At least one local account on the host has a SHA256 ($5$) or SHA512 ($6$) password hash configured.
4. At least one account contains a single asterisk ("*") in its password field in /etc/shadow.

The requirement for a SHA256 or SHA512 hash elsewhere in the shadow file relates to how musl initializes its internal hashing algorithms and salt parsing routines during runtime execution. If no valid SHA2-based accounts exist on the host system, musl’s execution path within crypt_r() evaluates differently, preventing the string collision condition.

Distribution / Platform Default C Library Default PAM Status Default Shadow Marker Vulnerability Status (Default Build)
Alpine Linux (v3.18 – v3.20) musl libc Disabled (No PAM) * (for locked system accounts) VULNERABLE
Debian GNU/Linux (11 / 12) glibc Enabled (PAM) ! or * Not Vulnerable (glibc / PAM active)
Ubuntu Server (22.04 / 24.04) glibc Enabled (PAM) ! Not Vulnerable (glibc / PAM active)
RHEL / Rocky Linux (8 / 9) glibc Enabled (PAM) !! Not Vulnerable (glibc / PAM active)
Custom Embedded / BusyBox musl libc Disabled (No PAM) * VULNERABLE

Minimal container environments and lightweight virtual machine images running Alpine Linux represent the primary exposure surface. Container maintainers frequently strip out PAM during binary compilation to eliminate unnecessary dependencies and reduce container image sizes. Combined with standard system accounts (e.g., guest, sshd, or vendor-defined service accounts) marked as disabled via an asterisk in /etc/shadow, these deployments present exposed entry points for automated scanners.

In-the-Wild Exploitation: GT10, TAC Agent, and Cryptomining Campaigns

Following public disclosure of CVE-2026-123158, threat intelligence providers recorded an immediate transition from theoretical proof-of-concept validation to high-velocity, automated exploitation campaigns. Security firm GreyNoise reported that honeypot infrastructure maintained across Southeast Asia detected structured intrusion campaigns conducted by a threat group tracked as GT10. Attackers deployed automated scanning frameworks capable of identifying vulnerable musl-based OpenSSH instances within seconds of initial port discovery.

Telemetry published by Previdian corroborated these findings, recording at least 20 distinct exploitation attempts originating from 13 unique IP addresses distributed across nine countries within the first few days of public disclosure. Simultaneously, security researchers at watchTowr observed widespread exploitation activity designed to recruit compromised Linux hosts into botnets and deploy unauthorized cryptocurrency mining applications.

+-----------------------------------------------------------------------------------+
|                        GT10 Threat Campaign Attack Flow                           |
+-----------------------------------------------------------------------------------+
|                                                                                   |
|  [ Attacker Infrastructure ]                                                      |
|               |                                                                   |
|               v  (Automated Port 22 Scan & >256 Char Password Payload)            |
|  [ Exposed Alpine Linux SSH Endpoint ]                                            |
|               |                                                                   |
|               v  (Bypass Authentication via CVE-2026-123158)                      |
|  [ Unauthenticated Shell Access Granted ]                                         |
|               |                                                                   |
|               v  (Execute Post-Exploitation Script)                               |
|  [ Package Manager Check: `apk add --no-cache python3` ]                          |
|               |                                                                   |
|               v  (Stage Backdoor Payload)                                         |
|  [ Write TAC Agent Python Script to /tmp or /var/tmp ]                            |
|               |                                                                   |
|               v  (Establish Command & Control / Persistence)                      |
|  [ Execute TAC Agent Backdoor & Deploy XMRig Cryptominer ]                        |
|                                                                                   |
+-----------------------------------------------------------------------------------+

The speed of campaign deployment highlights the operational efficiency of automated exploit frameworks. Attackers construct brute-force or dictionary sweeps where every password payload transmitted for common system usernames contains a repetitive padded string exceeding 256 characters (e.g., A * 300). When the target server grants shell access, the payload handler immediately executes scripted post-exploitation routines.

Threat Intelligence Analysis: Forensics of the TAC Agent Backdoor

Forensic examination of compromised systems monitored by GreyNoise revealed detailed insight into threat group GT10’s post-exploitation toolkit. Because target environments running musl libc—such as base Alpine Linux images—frequently omit high-level scripting interpreters to minimize image footprint, GT10’s initial payload executes an automated environment check. If Python 3 is absent, the script uses the target system’s package manager (e.g., apk add python3) to download and install the required runtime environment before stager execution.

Once Python 3 is established on the victim host, the attacker deploys a customized backdoor tracked by security researchers as TAC Agent. Analysis of the recovered source code provides several key forensic observations:

  • AI-Assisted Generation: Code structure, inline documentation, and error-handling routines within TAC Agent exhibit structural patterns strongly characteristic of Large Language Model (LLM) code generation outputs.
  • Language Artifacts: Variable naming conventions and inline developer comments embedded throughout the script contain simplified Chinese language text.
  • Core Functionality: TAC Agent operates as a lightweight, persistent remote access tool (RAT) capable of handling interactive command execution, host environment reconnaissance (gathering network interface details, container runtime markers, and environment variables), and establishing persistence through cron jobs or modified startup scripts.
  • Infrastructure Exposure: GreyNoise researchers successfully accessed a GT10 command-and-control (C2) server utilized during the campaign, uncovering evidence of additional victim systems across multiple geographic regions.

Forensic Note: Memory-Only Execution Strategies

While GT10 relies on installing Python3 via package managers to support TAC Agent, alternative cryptomining campaigns leveraging CVE-2026-123158 inject pure POSIX shell code directly through the SSH session channel. Systems administrators should monitor for unexpected process spawns directly from the sshd child process, regardless of whether Python 3 is installed on the host.

Detecting Active Exploitation and Compromised Musl Infrastructure

Defensive engineering teams must establish multi-layered detection strategies to identify both vulnerable infrastructure states and active compromise indicators across server fleets. Detection focuses on auditing host configuration files, analyzing SSH daemon authentication logs, and monitoring container process execution.

1. Host Configuration Auditing

Administrators can execute the following shell pipeline across Linux nodes to scan /etc/shadow for accounts configured with a single asterisk string (*) alongside active SHA256 or SHA512 password hashes:

# Audit /etc/shadow for vulnerable single-asterisk entries alongside SHA2-hashed accounts
# Test in staging before running in production environments

echo "=== Checking for SHA256/SHA512 Root or User Hashes ==="
grep -E '^\w+:\$(5|6)\$' /etc/shadow || echo "No SHA256/SHA512 hashes found."

echo "=== Checking for Accounts Locked with Single Asterisk '*' ==="
awk -F: '$2 == "*" {print $1}' /etc/shadow

If the audit returns both an active SHA256/SHA512 hash entry (e.g., for root or a management user) and one or more accounts containing strictly * in the second field, the host meets the shadow file prerequisite for CVE-2026-123158.

2. SSH Log Analysis

When an attacker attempts to exploit CVE-2026-123158, the OpenSSH daemon logs authentication events. Standard OpenSSH logging records successful authentications, but administrators monitoring log aggregators or journalctl should look for anomalous logins to system accounts that typically do not accept interactive passwords (e.g., bin, daemon, operator, nobody, or sshd).

# Query systemd journal for successful password authentications to disabled accounts
journalctl -u sshd -u ssh | grep -E "Accepted password for (daemon|bin|operator|sshd|guest|nobody)"

Additionally, network-level log inspects or SSH reverse-proxy logs may reveal unusually large password payload sizes exceeding 256 bytes during the initial SSH protocol key exchange and authentication negotiation phase.

3. Post-Exploitation Process and Package Anomalies

To detect TAC Agent or cryptomining payloads on minimal hosts (such as Alpine container instances), monitor host and container telemetry for unauthorized package additions or suspicious process spawns:

# Check Alpine package manager logs for unexpected runtime installations
grep -i "python3" /var/log/apk.log 2>/dev/null

# Inspect running processes for suspicious paths or high CPU usage
ps aux | grep -E "(python3|/tmp/|/var/tmp/|xmrig|minerd)"

Practical Remediation and Mitigation Steps for Technical Teams

Securing infrastructure against CVE-2026-123158 requires immediate remediation across operating system builds, configuration files, and authentication architecture choices. Security and operations teams should execute the following mitigation strategy.

1. Apply Upstream OpenSSH Security Updates

OpenSSH maintainers released an official software update to resolve the authentication evaluation flaw. Operating system vendors and distribution maintainers have begun integrating the upstream fix into standard package repositories. System administrators should immediately update their OpenSSH installation binaries across all musl-based hosts.

# For Alpine Linux systems, update repository indexes and upgrade openssh package
# Test in staging prior to production deployment
apk update && apk add --upgrade openssh

2. Hardening Shadow Account Entries

If updating binaries immediately is not feasible due to deployment schedules or vendor patch delays, administrators can neutralize the vulnerability by updating /etc/shadow entries. Changing single-asterisk status fields (*) to exclamation-asterisk prefixes (!*) or invalid hash strings prevents musl’s return value from matching the shadow entry.

# Safe remediation script to modify single asterisk shadow fields to '!*'
# Test in staging environment before applying to production fleets

sed -i 's/:\*:/:!\*:g' /etc/shadow

Changing the field to !* ensures that even if musl returns "*" during an error state, OpenSSH evaluates strcmp("*", "!*"), which yields non-equality and rejects the authentication attempt.

3. Enable Pluggable Authentication Modules (PAM)

Where operating system and image sizes permit, recompile or reconfigure OpenSSH to utilize PAM for authentication handling (--with-pam). When PAM handles the authentication sequence, account lock status and password hashing validation are isolated within dedicated PAM modules (such as pam_unix.so), preventing sshd from evaluating raw C library string comparison returns directly against shadow database entries.

4. Container Isolation and Incident Response Workflow

Because exploitation allows complete remote command execution, any musl-based container or host confirmed to have received successful exploitation payloads must be treated as fully compromised:

  1. Isolate: Immediately terminate internet access and network routing for the affected instance or container pod.
  2. Preserve: Take a snapshot of host memory and transient storage if required for forensic analysis.
  3. Rebuild: Do not attempt to clean compromised container filesystems in place. Destroy the instance and redeploy from a verified, patched, clean base image build pipeline.
  4. Rotate Credentials: Rotate all system keys, API tokens, database credentials, and SSH host keys present on or accessible from the compromised system.

Key Takeaways for Security Architects and System Administrators

The discovery and active exploitation of CVE-2026-123158 highlight fundamental architectural risks in modern system design, particularly as organisations increasingly adopt non-standard C library stacks to optimize container environments.

  • Assumptions in C Library Abstractions: Standard C library implementations (such as glibc vs musl) exhibit subtle variations in error handling, boundary bounds, and fallback return values. Security architectures cannot assume functional parity when swapping fundamental system libraries beneath core security daemons like OpenSSH.
  • Defense-in-Depth vs Optimization: Omitting framework layers such as PAM or using simplified standard account flags (*) to minimize binary footprint reduces defense-in-depth layers. Eliminating PAM removed an critical input evaluation barrier that would have otherwise prevented direct string comparisons against fallback error codes.
  • Rapid Exploitation Lifecycles: The timeframe between public vulnerability disclosure and automated exploitation campaigns targeting lightweight Linux environments is effectively zero. Automated threat actors continually monitor disclosure feeds to target public-facing SSH services using mass-scanning frameworks.

Infrastructure Hardening Recommendation

For minimal edge nodes and container workloads running OpenSSH, strictly enforce public-key authentication by setting PasswordAuthentication no inside /etc/ssh/sshd_config. Disabling password-based authentication mechanisms entirely bypasses the vulnerable code path inside OpenSSH and musl.

Frequently asked questions

Which Linux distributions are primarily affected by CVE-2026-123158?

Alpine Linux is the primary mainstream distribution affected due to its default reliance on musl libc, default disabled PAM builds, and single-asterisk shadow entries. Other custom embedded Linux distributions, minimal container base images, and lightweight network appliances built with musl libc and non-PAM OpenSSH builds are also fully vulnerable.

Why does submitting a password longer than 256 characters trigger authentication bypass?

Passing a password string exceeding 256 characters exceeds musl libc’s internal crypt function input limit. Rather than throwing a standard system error code or NULL pointer, musl returns the error string “*”. OpenSSH compares this returned string to shadow entries locked with an asterisk, misinterpreting the error value as a valid matching password hash.

Does enabling PAM prevent exploitation of CVE-2026-123158?

Yes. Enabling Pluggable Authentication Modules (PAM) delegates authentication validation to dedicated PAM modules (such as pam_unix) rather than internal OpenSSH string comparisons. This prevents the daemon from directly evaluating musl’s crypt error string against shadow file entry flags, neutralizing the vulnerable code path.

How can administrators verify if TAC Agent has been installed on a host?

Administrators should audit system process trees for unauthorized Python 3 processes executing out of temporary directories (/tmp or /var/tmp). Inspecting package manager logs (such as /var/log/apk.log on Alpine Linux) for recent unauthorized installs of python3, alongside auditing cron jobs and system startup scripts, will help identify TAC Agent persistence artifacts.

Sources and further reading

This article was drafted with AI assistance from the publicly cited sources and passed automated checks for structure and sourcing. Verify critical details against the vendor advisories linked above before acting.