CVE-2026-66032
High · 8.8CVSS
8.8
EPSS
0.4%
Published
Jul 24, 2026
CISA due date
—
Cloudanix analysis
A malicious file-transfer server could crash or possibly take over software that connects to it for SFTP file transfers.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Remote Code Execution
- Component
- Library
- Class
- Use After Free
- Remediation
- Patch
- Effort
- Low
- Patch risk
- Low
What it actually does
CVE-2026-66032 is a client-side heap corruption flaw in libssh2's SFTP implementation. In affected versions through libssh2 1.11.1, the sftp_open() logic can free the same response buffer twice when a malicious SSH/SFTP server replies to an SSH_FXP_OPEN request with SSH_FXP_STATUS and FX_OK, followed by an error path such as LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED from sftp_packet_require(). On glibc-based systems this can create tcache-dup heap conditions, potentially enabling overlapping allocations, function pointer overwrite, process crash, or code execution in the context of the vulnerable client process. Exploitation requires the vulnerable application to authenticate to and open an SFTP session against an attacker-controlled or compromised SSH server.
Why it matters to the business
Applications, automation jobs, agents, backup tools, CI/CD systems, file-transfer workflows, and embedded products that use libssh2 as an SFTP client may be crashed or potentially taken over if they connect to a malicious or compromised SSH/SFTP endpoint. Because libssh2 is commonly embedded in downstream software, exposure may exist indirectly through vendor products rather than only through explicitly installed libssh2 packages. The issue is not currently in CISA KEV, is not reported as ransomware-used, has low EPSS at 0.00276, and has no public exploit maturity reported, but the high CVSS score reflects the potential for severe client-side compromise where SFTP connections are made to untrusted or attacker-influenced servers.
How an attack unfolds
An attacker first needs to cause a vulnerable libssh2-based client to initiate an authenticated SFTP connection to an SSH server the attacker controls or has compromised. After authentication, the client attempts to open a file over SFTP, invoking sftp_open(). The malicious server sends a crafted SSH_FXP_STATUS response with FX_OK to the client's SSH_FXP_OPEN request, causing libssh2 to release the response buffer. The server then manipulates packet flow so that a later sftp_packet_require() call fails on a specific error path, such as LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED. The affected code attempts to free the same pointer again, corrupting heap allocator metadata. On glibc systems, the attacker may be able to use tcache-dup behavior to create overlapping allocations and overwrite control data, potentially leading to arbitrary code execution inside the client process. Failed attempts are more likely to appear as abrupt client crashes, allocator aborts, or SFTP session failures.
How to fix it
Upgrade affected libssh2 packages to a vendor-fixed build. For the listed Red Hat package, update libssh2-main to 1.11.1-10.2.hum1 or later as provided by RHSA-2026:46927. Where libssh2 is statically linked or vendored into applications, rebuild or update the dependent application against a patched libssh2 containing commit 5e47761 or a later vendor security release. Inventory products that bundle libssh2, including file-transfer utilities, backup products, agents, CI/CD runners, package managers, and embedded appliances. As interim mitigation, restrict SFTP clients to trusted server allowlists, block connections to untrusted SSH/SFTP destinations, enforce SSH host key verification, prevent users or automation from accepting unknown host keys, and run SFTP-capable workloads with least privilege and process isolation. If rapid patching is not possible, prioritize systems that initiate SFTP connections to third-party, internet-facing, partner-managed, or otherwise less trusted SSH servers.
How to confirm the fix worked
Confirm installed package versions report a fixed release, specifically libssh2-main 1.11.1-10.2.hum1 or later for the listed Red Hat advisory. For dynamically linked applications, verify they load the patched libssh2 shared library at runtime rather than an older bundled copy. For statically linked or containerized applications, inspect images and software bills of materials for libssh2 versions through 1.11.1 and rebuild them with a patched library. Validate that SFTP workflows still complete successfully after patching. Confirm SSH host key verification is enforced and that automation cannot connect to unapproved SFTP servers. If available, use vulnerability scanners, package inventory, SBOM tooling, and runtime dependency inspection to ensure no remaining libssh2 copies are present in application directories, containers, appliances, or vendor-delivered binaries.
Typical attack path
- Identify software or automation that uses libssh2 for outbound SFTP connections.
- Place, compromise, spoof, or lure the client toward an attacker-controlled SSH/SFTP server.
- Allow or complete SSH authentication so the client proceeds into SFTP operations.
- Wait for the client to issue an SSH_FXP_OPEN request through libssh2's sftp_open() path.
- Return a crafted SSH_FXP_STATUS response containing FX_OK and manipulate subsequent packet behavior to trigger an sftp_packet_require() error such as LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED.
- Trigger the double-free condition in the client process.
- Exploit heap corruption for process crash or attempt tcache-based memory corruption leading to code execution in the vulnerable client context.
How to detect it
Look for evidence of vulnerable clients connecting to suspicious or unexpected SSH/SFTP servers followed by process crashes, allocator aborts, or abnormal termination. Useful sources include endpoint detection telemetry, Linux audit logs, systemd journal, application logs from SFTP-capable tools, core dump records, container runtime logs, SSH client library debug logs, outbound network flow records to TCP/22 or alternate SFTP ports, and vulnerability/SBOM inventories showing libssh2 through 1.11.1. Because exploitation is server-driven, detection should focus on client-side symptoms after outbound SFTP activity: glibc double-free/tcache errors, SIGABRT/SIGSEGV, repeated SFTP open failures, and unexpected crashes in applications known to use libssh2. Investigate any crash where logs show SSH_FXP_OPEN, SSH_FXP_STATUS, FX_OK, or LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED near the failure. Correlate with connections to unknown SSH host keys, newly introduced SFTP destinations, untrusted partner servers, or infrastructure not previously contacted by the client. Successful exploitation may leave few protocol-level indicators beyond the crash or compromise of the client process, so memory forensics, core dump analysis, and EDR process lineage should be used for high-value systems.
- LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED
- SSH_FXP_OPEN
- SSH_FXP_STATUS
- FX_OK
- double free detected in tcache
- free(): double free detected in tcache 2
- malloc(): unaligned tcache chunk detected
- malloc(): memory corruption
- corrupted double-linked list
- SIGABRT
- SIGSEGV
- sftp_open()
- src/sftp.c
- libssh2.so
- libssh2 1.11.1
- libssh2-main-1.11.1
- 1.11.1-10.2.hum1
- RHSA-2026:46927
- commit 5e47761
What your security team should do
- Prioritize patching systems and applications that use libssh2 to connect outbound to SFTP servers, especially internet-facing, partner-managed, or user-specified destinations.
- Update Red Hat libssh2-main packages to 1.11.1-10.2.hum1 or later under RHSA-2026:46927, and track equivalent fixes from all other operating system, container, and application vendors.
- Search SBOMs, container images, build artifacts, and vendor packages for embedded or statically linked libssh2 copies because downstream prevalence can hide exposure outside normal OS package inventories.
- Enforce SSH/SFTP destination allowlisting and strict host key verification to reduce the chance that clients connect to malicious servers.
- Monitor for abnormal crashes in libssh2-based clients, especially allocator errors or SIGABRT/SIGSEGV events shortly after outbound SFTP connections.
- Review recent outbound SFTP connections to unknown, newly added, or unexpected SSH servers, and investigate failed sessions that coincide with client crashes.
- Run high-risk SFTP automation under least-privilege service accounts and contain it with sandboxing, container isolation, SELinux/AppArmor, or equivalent controls.
The record
libssh2 through 1.11.1, fixed in commit 5e47761, contains a double-free vulnerability in the sftp_open() function in src/sftp.c that allows a malicious SSH server to corrupt the heap of any authenticated client opening an SFTP session. When a server responds to SSH_FXP_OPEN with SSH_FXP_STATUS containing FX_OK, the response data buffer is freed, and if a subsequent sftp_packet_require() call returns a specific error such as LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED, the same pointer is freed a second time, enabling tcache dup conditions on glibc systems that allow overlapping allocations and function pointer overwrites.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-121507 Double Free in µD3TN BPv6 Fragmenter Block Duplication allows Unauthenticated Remote… CWE-415
- CVE-2026-58968 In oapvd_vlc_metadata of oapv_vlc.c, there is a possible memory corruption due to a… CWE-415
- CVE-2026-20582 In usb, there is a possible memory corruption due to double free. CWE-415
- CVE-2026-20573 In afe, there is a possible memory corruption due to double free. CWE-415
- CVE-2026-119338 Tesseract is an open source OCR engine. CWE-415
- CVE-2026-119116 A use-after-free and double-free issue in the SetClient command handler of the… CWE-415
- CVE-2026-85890 Double free in Microsoft Edge (Chromium-based) allows an unauthorized attacker to execute… CWE-415
- CVE-2026-83831 Double free in Microsoft Edge (Chromium-based) allows an unauthorized attacker to execute… CWE-415