CVE-2026-66035libssh2 Heap Buffer Overflow via ETM Cipher Negotiation
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.
What to do
Fixed builds are available from Alpine, Debian, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | libssh2 | Fixed | 1.11.1-1ubuntu0.26.04.4 | UBUNTU-CVE-2026-66035 |
| Ubuntu 24.04 | libssh2 | Fixed | 1.11.0-4.1ubuntu0.24.04.4 | UBUNTU-CVE-2026-66035 |
| Ubuntu 22.04 | libssh2 | Under investigation | UBUNTU-CVE-2026-66035 | |
| Ubuntu 20.04 | libssh2 | Fix pending | UBUNTU-CVE-2026-66035 | |
| Ubuntu 18.04 | libssh2 | Fix pending | UBUNTU-CVE-2026-66035 | |
| Ubuntu 16.04 | libssh2 | Fix pending | UBUNTU-CVE-2026-66035 | |
| Ubuntu 14.04 | libssh2 | Fix pending | UBUNTU-CVE-2026-66035 | |
| Debian 14 | libssh2 | Fixed | 1.11.1-5 | DEBIAN-CVE-2026-66035 |
| Debian 13 | libssh2 | Fixed | 1.11.1-1+deb13u2 | DEBIAN-CVE-2026-66035 |
| Red Hat Enterprise Linux 7 | libssh2 | Not affected | ||
| Red Hat Enterprise Linux 7 | libssh2-devel | Not affected | ||
| Red Hat Enterprise Linux 7 | libssh2-docs | Not affected | ||
| Red Hat Enterprise Linux 6 | libssh2 | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | libssh2-devel | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | libssh2-docs | Will not fix Out of support scope | ||
| Alpine Linux 3.24 | libssh2 | Fixed | 1.11.1-r4 | ALPINE-CVE-2026-66035 |
| Alpine Linux 3.23 | libssh2 | Fixed | 1.11.1-r4 | ALPINE-CVE-2026-66035 |
| Alpine Linux 3.22 | libssh2 | Fixed | 1.11.1-r3 | ALPINE-CVE-2026-66035 |
| Alpine Linux 3.21 | libssh2 | Fixed | 1.11.1-r3 | ALPINE-CVE-2026-66035 |
What the vendor says
As published in the CVE record by VulnCheck, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- libssh2: affected: up to 1.11.1, 42e33d81577ed4b95d4b4f6f845e5ee8efe5eeb4 not affected
Vendor advisories:
- https://github.com/libssh2/libssh2/pull/2198 (patch)
- https://github.com/libssh2/libssh2/commit/42e33d81577ed4b95d4b4f6f845e5ee8efe5eeb4 (patch)
References
- https://github.com/libssh2/libssh2/pull/2198
- https://github.com/libssh2/libssh2/commit/42e33d81577ed4b95d4b4f6f845e5ee8efe5eeb4
- https://www.vulncheck.com/advisories/libssh2-heap-buffer-overflow-via-etm-cipher-negotiation
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.