CVE-2026-66035

libssh2 Heap Buffer Overflow via ETM Cipher Negotiation

Published Jul 24, 2026 CVSS 4.0 · 7.7 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

A pre‑authentication heap buffer overflow exists in libssh2 versions up to 1.11.1. During Encrypt‑then‑MAC (ETM) cipher negotiation the server sends a packet whose declared length is smaller than the block size. The client allocates a buffer of that length but copies a larger block into it, overwriting heap metadata. On 32‑bit glibc this corrupts a chunk’s SIZE field, enabling tcache bin confusion, overlapping live objects, and ultimately a function pointer overwrite before authentication is completed. The overflow therefore permits an attacker to execute arbitrary code in the client process during the SSH session establishment.

Affected Systems

The vulnerability affects all installations of libssh2 up to and including version 1.11.1, regardless of the platform, because the issue is in the core transport implementation. Any client that imports libssh2 and connects to a malicious SSH server may be exposed. Upgrades to libssh2 1.11.2 or later contain the fix evidenced by commit 42e33d8.

Risk and Exploitability

The CVSS score of 7.7 indicates a high severity. The EPSS score of less than 1% suggests that exploitation is currently uncommon or difficult. The vulnerability is not listed in the CISA KEV catalog. Attack requires an untrusted SSH server to send a malformed ETM packet before client authentication. The lack of authentication at the beginning of the handshake makes exploitation likely if the attacker controls the server side.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update libssh2 to a fixed version (1.11.2 or later) that includes commit 42e33d8.
  • If immediate upgrade is not feasible, disable or block the use of ETM cipher negotiation in the client configuration to prevent the overflow condition.
  • Deploy network monitoring or firewall rules to detect and block SSH connections that send packet lengths smaller than the expected block size, thereby mitigating potential exploitation until a patch can be applied.

Generated by OpenCVE AI on August 3, 2026 at 19:49 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:libssh2:libssh2:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Redhat
Redhat hummingbird
Weaknesses CWE-120
CPEs cpe:/a:redhat:hummingbird:1
Vendors & Products Redhat
Redhat hummingbird
References
Metrics threat_severity

None

threat_severity

Moderate

Type Values Removed Values Added
First Time appeared Libssh2
Libssh2 libssh2
Vendors & Products Libssh2
Libssh2 libssh2
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title libssh2 Heap Buffer Overflow via ETM Cipher Negotiation
Weaknesses CWE-122
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 7.7, 'vector': 'CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-120

    Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')

  • CWE-122

    Heap-based Buffer Overflow

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Jul 28, 2026, 1:06 AM
Reserved
Jul 23, 2026, 8:45 PM
Status
Analyzed
Published
Jul 24, 2026, 5:17 PM
Modified
Nov 8, 2026, 8:10 PM
Severity
Moderate
Public date
Jul 24, 2026, 4:45 PM