Double-Free vulnerability in libssh2 sftp_open() (1.11.1)
CVE-2026-66032 Published on July 24, 2026
libssh2 Double-Free Heap Corruption via sftp_open()
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.
Vulnerability Analysis
CVE-2026-66032 is exploitable with network access, requires user interaction. This vulnerability is considered to have a low attack complexity. The potential impact of an exploit of this vulnerability is considered to be very high.
Weakness Type
What is a Double-free Vulnerability?
The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations. When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.
CVE-2026-66032 has been classified to as a Double-free vulnerability or weakness.
Products Associated with CVE-2026-66032
Want to know whenever a new CVE is published for Libssh2? stack.watch will email you.
Affected Versions
libssh2:- Before and including 1.11.1 is affected.
- Version 5e4776146552d898b9c0e1b313cd093fa8dc92d0 is unaffected.