Skip to main content
Mallory
← Back to News
open-source-dependency-vulnerabilityproof-of-concept-release

libssh2 Fixes High-Severity Double-Free in `sftp_open()`

Vulnerability Disclosure · 6 sources · Updated 4mo ago · First seen Jul 24, 2026

libssh2 Fixes High-Severity Double-Free in `sftp_open()`

A high-severity memory-safety flaw tracked as CVE-2026-66032 was disclosed in libssh2 through version 1.11.1, affecting the sftp_open() function in src/sftp.c. The bug allows a malicious SSH server to trigger a double free in an authenticated client that opens an SFTP session, creating heap corruption conditions. Advisory details say the issue occurs when the server responds to SSH_FXP_OPEN with SSH_FXP_STATUS containing FX_OK and a later sftp_packet_require() call returns a specific error such as LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED, causing the same response buffer to be freed twice.

The libssh2 project addressed the flaw in commit 5e4776146552d898b9c0e1b313cd093fa8dc92d0, merged through pull request #2180, by nullifying the pointer after it is freed in the SFTP code. The fix, which also resolves advisory GHSA-px3w-7g75-hg7w, credits VladimirEliTokarev for reporting the issue. Security writeups warn that on glibc-based systems the bug can produce tcache-dup style heap corruption, potentially enabling overlapping allocations and function pointer overwrites, and users are advised to update libssh2 or apply the patch and recompile.

Why it matters

Impact assessment

Affects organizations and software vendors that use libssh2-based SSH/SFTP client functionality, especially applications that connect to untrusted, third-party, or internet-exposed SSH servers. The immediate risk is client-side memory corruption, crashes, and potential code execution; exposure is broader than a single application because libssh2 is widely embedded and may be statically bundled.

This story centers on CVE-2026-66032, but the referenced disclosures indicate four high-severity libssh2 flaws affecting versions through 1.11.1. Exploitation requires a malicious server or man-in-the-middle position during SSH/SFTP interactions, making the risk most acute for automated file transfer clients, backup tools, integration middleware, developer tooling, and enterprise applications that initiate outbound SSH/SFTP sessions.

Supporting facts

  • Affected product: libssh2 through version 1.11.1.
  • Primary issue: CVE-2026-66032, high-severity double free in sftp_open().
  • Additional disclosed issues in the same timeframe: CVE-2026-66033, CVE-2026-66034, CVE-2026-66035.
  • Affected population: SSH/SFTP client applications using libssh2, including software that statically bundles the library.
  • Trigger model: malicious SSH server responses to a connecting client.
  • Business impact: application crashes, failed file transfers, service instability, and possible client-side code execution from heap corruption.
  • Scope: potentially widespread due to libssh2 reuse across products, but exploitation is targeted to clients that connect to attacker-controlled or compromised servers.
  • Known exploitation: no in-the-wild exploitation was cited in the references; SSVC data for CVE-2026-66032 lists exploitation as none.
  • Severity: CVE-2026-66032 scored CVSS 3.1 8.8 and CVSS 4.0 8.7, both High.
Do you run this?See affected versions and whether adversaries are exploiting it.
Check your exposure
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

3 events · Jul 2, 2026 – Jul 24, 2026
  1. Jul 24, 20264mo ago

    Three additional libssh2 CVEs disclosed alongside CVE-2026-66032

    On 2026-07-24, three additional high-severity libssh2 flaws were disclosed: CVE-2026-66033, CVE-2026-66034, and CVE-2026-66035. The issues affect libssh2 1.11.1 and earlier and can cause memory corruption, crashes, or possible code execution when clients connect to a malicious SSH server; the report says each has an upstream fix commit.

    libssh2 Vulnerabilities Allows a Malicious SSH Server to Corrupt Client Memory
  2. Jul 24, 20264mo ago

    CVE-2026-66032 published for libssh2 double-free flaw

    CVE-2026-66032 was published for a high-severity double-free vulnerability in libssh2 through version 1.11.1 affecting sftp_open(). The disclosure states that a malicious SSH server can trigger heap corruption in an authenticated client opening an SFTP session, and notes the issue is fixed by commit 5e4776146552d898b9c0e1b313cd093fa8dc92d0.

    CVE-2026-66032 - libssh2 Double-Free Heap Corruption via sftp_open()
  3. Jul 2, 20265mo ago

    libssh2 merges fix for sftp_open dangling pointer issue

    A libssh2 pull request to nullify a pointer after freeing it in src/sftp.c was merged into the master branch as commit 5e47761. The change explicitly fixes advisory GHSA-px3w-7g75-hg7w and credits VladimirEliTokarev for the report.

    Prevent dangling pointer by nullifying data (#2180) · libssh2/libssh2@5e47761 · GitHub
Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →

Organizations

1 linked
Libssh2
Do you run this?See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
Check Your Exposure
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.