Cloudanix VulnDB

CVE-2026-66034

High · 7.5

CVSS

7.5

EPSS

0.4%

Published

Jul 24, 2026

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A malicious SSH server can crash or potentially compromise software that uses a vulnerable SSH library when that software connects to it.

Chainable
Exploitation
Requires User Interaction
Attacker needs
None
Complexity
High
Impact
Data Exposure
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

This vulnerability is a client-side memory-corruption flaw in libssh2 through 1.11.1, specifically in the public key subsystem response parsing performed by libssh2_publickey_list_fetch(). A malicious SSH server can return a crafted version 1 publickey response containing a server-controlled comment_len value that is not properly bounds-checked before the parser advances through the buffer. This can cause an arbitrary-length heap out-of-bounds read that may disclose adjacent heap contents, including pointers useful for bypassing ASLR, and can then trigger cleanup behavior that frees an uninitialized pointer from a non-zeroed realloc() region, potentially corrupting heap allocator state. The practical impact is most likely client process crash or sensitive memory disclosure, with a theoretical path toward code execution depending on allocator behavior, build hardening, and application use of libssh2.

Why it matters to the business

Applications and automation that use libssh2 to connect to SSH servers can be compromised or disrupted if they are induced to connect to a malicious or attacker-controlled SSH endpoint. Business consequences include outages in tools that rely on SSH-based file transfer, deployment, backup, scanning, or orchestration; possible exposure of in-process secrets or memory contents; and increased risk where automated systems connect to untrusted SSH hosts. The CVSS score is high at 7.5, but exploitation requires user or workflow interaction with a malicious server and currently has low EPSS and no known CISA KEV listing, so urgency is highest for internet-facing automation, security scanners, CI/CD systems, and products that initiate SSH connections to third-party or user-supplied hosts.

How an attack unfolds

An attacker positions or controls an SSH server that a vulnerable libssh2-based client will connect to, such as through a malicious repository, infrastructure endpoint, test target, SFTP destination, or host provided to an automated workflow. After the client establishes an SSH session and invokes the libssh2 public key subsystem, the malicious server sends a crafted version 1 response with a manipulated comment_len field. The vulnerable parser trusts this length and advances beyond the actual response buffer, causing heap data adjacent to the allocation to be read. This may disclose heap pointers or other process memory that can weaken address-space randomization. When parsing fails and cleanup occurs, the library can attempt to free an uninitialized pointer from memory returned by realloc(), corrupting heap allocator state and typically crashing the process. In more advanced exploitation scenarios, the attacker would attempt to combine the memory disclosure and heap corruption to influence control flow, but exploitability is expected to be environment-dependent and no public mature exploit is indicated.

How to fix it

Upgrade affected libssh2 packages to a fixed build. For the listed Red Hat package, update libssh2-main to 1.11.1-10.2.hum1 or later as provided in RHSA-2026:46927. Where libssh2 is statically linked or embedded in appliances, agents, CLI tools, security scanners, backup products, CI/CD components, or custom applications, rebuild or obtain vendor updates that include the upstream fix from commit a13bb6c or an equivalent bounds-checking patch. If immediate patching is not possible, reduce exposure by preventing vulnerable clients from connecting to untrusted SSH servers, disabling features that invoke the libssh2 publickey subsystem where feasible, restricting user-supplied SSH destinations, enforcing allowlists for SSH endpoints, and isolating automation that must connect to untrusted hosts.

How to confirm the fix worked

Confirm the installed or bundled libssh2 version and package release is fixed. On RPM-based systems, verify the package release is at least the fixed Red Hat build, for example by checking package metadata for libssh2-main version 1.11.1-10.2.hum1 or later and confirming the referenced security advisory has been applied. For applications that vendor or statically link libssh2, inspect SBOMs, build manifests, binary dependency reports, or vendor attestations to confirm inclusion of the a13bb6c fix or equivalent bounds-check validation in libssh2_publickey_list_fetch(). Validate operational exposure by inventorying software that initiates SSH/SFTP connections using libssh2 and identifying whether it can connect to user-controlled or untrusted servers. Regression testing should include connecting a patched client to malformed publickey subsystem responses and confirming it rejects the response cleanly without out-of-bounds reads, allocator errors, or process crashes under ASAN, Valgrind, or equivalent memory-safety tooling.

Typical attack path

  1. Identify an application, service, script, scanner, or automation job that uses a vulnerable libssh2 version as an SSH client.
  2. Cause that client to connect to an attacker-controlled or compromised SSH server, often through user-supplied host input, phishing, poisoned configuration, malicious test infrastructure, or redirection of an expected SSH endpoint.
  3. Complete enough of the SSH negotiation for the client to invoke the publickey subsystem and call libssh2_publickey_list_fetch().
  4. Return a crafted version 1 publickey response containing a malicious comment_len value that exceeds the remaining response buffer.
  5. Trigger a heap out-of-bounds read that may expose adjacent heap contents, including memory pointers useful for weakening ASLR.
  6. Trigger the error cleanup path that frees an uninitialized pointer, causing heap allocator corruption and usually a client crash.
  7. Optionally attempt further exploitation using leaked heap information and allocator manipulation, depending on target platform protections and process context.

How to detect it

Look for evidence that vulnerable libssh2-based clients connected to suspicious or attacker-controlled SSH servers and then crashed or reported heap corruption. Relevant sources include application logs for SSH/SFTP clients and automation tools, system logs, EDR process telemetry, crash reporters, core dump indexes, package inventory, network proxy/firewall logs for outbound SSH connections, and any packet captures of SSH sessions to unfamiliar hosts. Focus on client-side events where a process using libssh2 terminates unexpectedly shortly after initiating SSH or SFTP traffic, especially if the destination was newly observed, user-supplied, external, or inconsistent with normal automation behavior. On Linux, search journal logs, syslog, auditd, ABRT, systemd-coredump, kernel logs, and EDR telemetry for allocator errors such as invalid free, double free, corrupted size, malloc corruption, segmentation fault, or abort signals associated with SSH-capable tools. If core dumps are available, examine stack traces for libssh2_publickey_list_fetch(), libssh2 publickey subsystem calls, or cleanup paths following malformed server responses. Network content detection is difficult because SSH traffic is encrypted after session setup; however, metadata-based detection can identify unusual outbound TCP/22 or alternate SSH-port connections followed by immediate client crashes. There are no known threat actors, KEV exploitation, ransomware use, or public exploit indicators provided for this issue, so detection should be behavior- and artifact-driven rather than IOC-only.

  • libssh2_publickey_list_fetch
  • libssh2_publickey_list_fetch()
  • publickey subsystem
  • free(): invalid pointer
  • free(): invalid size
  • malloc(): corrupted top size
  • malloc(): memory corruption
  • corrupted size vs. prev_size
  • double free or corruption
  • munmap_chunk(): invalid pointer
  • Segmentation fault
  • SIGSEGV
  • SIGABRT
  • Aborted (core dumped)
  • systemd-coredump
  • core dumped
  • invalid free
  • heap corruption
  • RHSA-2026:46927
  • libssh2-main-1.11.1-10.2.hum1

What your security team should do

  • Prioritize patching systems and products that use libssh2 as an SSH client and connect to internet-facing, third-party, user-supplied, or otherwise untrusted SSH servers.
  • Update Red Hat libssh2-main packages to 1.11.1-10.2.hum1 or later, and track RHSA-2026:46927 through normal vulnerability-management workflows.
  • Inventory embedded and statically linked libssh2 copies in internal applications, appliances, agents, developer tools, scanners, SFTP clients, backup tooling, and CI/CD systems, because OS package updates may not remediate bundled copies.
  • Temporarily restrict vulnerable clients to an allowlist of trusted SSH hosts and block arbitrary SSH/SFTP destinations until patching is complete.
  • Monitor for unexpected crashes, heap corruption messages, or abnormal termination in libssh2-based clients shortly after SSH connections to unfamiliar hosts.
  • Treat suspicious crashes during SSH publickey subsystem operations as potential exploitation attempts and preserve core dumps, client logs, and network captures for analysis.
  • Because there is no current KEV listing, no ransomware association, low EPSS, and no mature public exploit reported, apply risk-based prioritization rather than emergency global shutdown, while still addressing high-exposure automation promptly.

The record

libssh2 through 1.11.1, fixed in commit a13bb6c, contains a missing bounds check vulnerability that allows a malicious SSH server to trigger an arbitrary-length heap out-of-bounds read and a free of an uninitialized pointer via the publickey subsystem. In libssh2_publickey_list_fetch(), the version 1 response parser reads a server-controlled comment_len value and advances the parse pointer without verifying sufficient bytes remain in the buffer, causing the out-of-bounds read to leak heap pointers from adjacent allocations defeating ASLR, followed by heap allocator state corruption when the error cleanup path frees an uninitialized pointer from a non-zeroed realloc() region.

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities