Vulnerability · Published Jul 24, 2026 · Assigned by VulnCheck
CVE-2026-66035libssh2 Heap Buffer Overflow via ETM Cipher Negotiation
High 7.5
In plain English
A high-severity heap buffer overflow in libssh2 from libssh2. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 41% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
libssh2 through 1.11.1, fixed in commit 42e33d8, contains a pre-authentication heap buffer overflow vulnerability that allows a malicious SSH server to corrupt heap metadata in any connecting client by sending a packet with a packet_length smaller than the cipher's block size during Encrypt-then-MAC cipher negotiation. In the fullpacket() function in src/transport.c, the ETM path allocates a buffer of packet_length bytes but copies blocksize minus one bytes via memcpy, causing an overflow that on 32-bit glibc writes attacker-controlled bytes into an adjacent chunk's SIZE field, enabling tcache bin confusion, overlapping live objects, and function pointer overwrite during the session handshake before authentication.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.21 | libssh2 | 1.11.1-r3 | ALPINE-CVE-2026-66035 |
| Alpine:v3.22 | libssh2 | 1.11.1-r3 | ALPINE-CVE-2026-66035 |
| Alpine:v3.23 | libssh2 | 1.11.1-r4 | ALPINE-CVE-2026-66035 |
| Alpine:v3.24 | libssh2 | 1.11.1-r4 | ALPINE-CVE-2026-66035 |
| Debian:13 | libssh2 | 1.11.1-1+deb13u2 | DEBIAN-CVE-2026-66035 |
| Debian:14 | libssh2 | 1.11.1-5 | DEBIAN-CVE-2026-66035 |
| Ubuntu:22.04:LTS | libssh2 | no fix listed | UBUNTU-CVE-2026-66035 |
| Ubuntu:24.04:LTS | libssh2 | 1.11.0-4.1ubuntu0.24.04.4 | USN-8722-1 |
| Ubuntu:24.04:LTS | libssh2 | 1.11.0-4.1ubuntu0.24.04.4 | UBUNTU-CVE-2026-66035 |
| Ubuntu:26.04:LTS | libssh2 | 1.11.1-1ubuntu0.26.04.4 | USN-8722-1 |
| Ubuntu:26.04:LTS | libssh2 | 1.11.1-1ubuntu0.26.04.4 | UBUNTU-CVE-2026-66035 |
Affected products (as reported)
Weakness: CWE-122 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
References
- Pull Request issue-tracking, patch
- Patch Commit patch
- https://www.vulncheck.com/advisories/libssh2-heap-buffer-overflow-via-etm-cipher-negotiation third-party-advisory