Skip to content
Heist/ feed
Back to feed
HighFix available

libssh2 — security advisory

Type: advisorySources: OSVAdvisory ID: ALPINE-CVE-2026-66035

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.

Products
libssh2
Affected versions
Not specified
Fixed versions
1.11.1-r3, 1.11.1-r4
CVEs
CVE-2026-66035
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 13:44 UTC · Revision 1

Source evidence

ALPINE-CVE-2026-66035

core-osv · Original source

Published 24 Jul 2026, 17:17 UTC

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.

osv:ALPINE-CVE-2026-66035

libssh2

Fixed versions: 1.11.1-r3

libssh2

Fixed versions: 1.11.1-r3

libssh2

Fixed versions: 1.11.1-r4

libssh2

Fixed versions: 1.11.1-r4

Complete source record
{
  "id": "956fe0c835f025cee84acfaf87d289ceaaecf2e6064bfc90caccdab5a59333e4",
  "url": "https://osv.dev/vulnerability/ALPINE-CVE-2026-66035",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "ALPINE-CVE-2026-66035",
    "summary": "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.",
    "evidence": "osv:ALPINE-CVE-2026-66035",
    "products": [
      {
        "name": {
          "value": "libssh2",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "1.11.1-r3",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "libssh2",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "1.11.1-r3",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "libssh2",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "1.11.1-r4",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "libssh2",
          "evidence": "/affected/3/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "1.11.1-r4",
            "evidence": "/affected/3/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "ALPINE-CVE-2026-66035",
      "aliases": [
        "ALPINE-CVE-2026-66035"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "1.11.1-r3"
                }
              ]
            }
          ],
          "package": {
            "name": "libssh2",
            "purl": "pkg:apk/alpine/libssh2?arch=source",
            "ecosystem": "Alpine:v3.21"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2026-66035.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "1.11.1-r3"
                }
              ]
            }
          ],
          "package": {
            "name": "libssh2",
            "purl": "pkg:apk/alpine/libssh2?arch=source",
            "ecosystem": "Alpine:v3.22"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2026-66035.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "1.11.1-r4"
                }
              ]
            }
          ],
          "package": {
            "name": "libssh2",
            "purl": "pkg:apk/alpine/libssh2?arch=source",
            "ecosystem": "Alpine:v3.23"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2026-66035.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "1.11.1-r4"
                }
              ]
            }
          ],
          "package": {
            "name": "libssh2",
            "purl": "pkg:apk/alpine/libssh2?arch=source",
            "ecosystem": "Alpine:v3.24"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/alpine/ALPINE-CVE-2026-66035.json"
          },
          "ecosystem_specific": {}
        }
      ],
      "modified": "2026-10-21T08:30:02.573713663Z",
      "provider": "osv",
      "upstream": [
        "CVE-2026-66035"
      ],
      "references": [
        "https://security.alpinelinux.org/vuln/CVE-2026-66035"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2026-66035",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 391832,
  "published_at": "2026-07-24T17:17:35.547+00:00"
}