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.
Published: 2026-07-24
Score: 7.7 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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 yet.

History

Tue, 28 Jul 2026 01:30:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:libssh2:libssh2:*:*:*:*:*:*:*:*

Tue, 28 Jul 2026 00:15:00 +0000

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


Fri, 24 Jul 2026 23:00:00 +0000

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

Fri, 24 Jul 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 24 Jul 2026 18:30:00 +0000

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'}


Subscriptions

Libssh2 Libssh2
Redhat Hummingbird
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-28T01:06:26.873Z

Reserved: 2026-07-23T20:45:17.816Z

Link: CVE-2026-66035

cve-icon Vulnrichment

Updated: 2026-07-24T17:59:22.202Z

cve-icon NVD

Status : Analyzed

Published: 2026-07-24T17:17:35.547

Modified: 2026-07-30T15:41:05.690

Link: CVE-2026-66035

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-07-24T16:45:24Z

Links: CVE-2026-66035 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T20:00:12Z

Weaknesses
  • CWE-120

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

  • CWE-122

    Heap-based Buffer Overflow