# CVE-2026-55200: libssh2 Integer Overflow to Heap Out-of-Bounds Write in ssh2_transport_read()

> An integer-overflow-to-heap-buffer-overflow flaw (CWE-680) in libssh2's ssh2_transport_read() fails to enforce upper bounds on the SSH packet_length field, letting a malicious or MITM SSH peer trigger a pre-authentication out-of-bounds heap write that can lead to remote code execution or denial of service. All versions through libssh2 1.11.1 are affected; the fix was merged in commit 97acf3df (PR #2052).

- **Published:** 2026-06-24T00:00:00Z
- **Last reviewed:** 2026-06-24T00:00:00Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-0931
- **Card image:** https://intel.threadlinqs.com/og/threat/threat-intel-libssh2-packet-length-overflow-tl-2026-0931.webp?v=eed17076 (Threadlinqs threat intel: CVE-2026-55200 libssh2 Packet Overflow: Detection & IOCs (TL-2026-0931) — Critical severity, 20 IOCs, 9 detection rules.)
- **ID:** TL-2026-0931
- **Severity:** CRITICAL (CVSS 9.2)
- **Category:** VULNERABILITY
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 20 (3 shown free below)
- **CVEs:** CVE-2026-55200

## Description

CVE-2026-55200 is a critical (CVSS v4.0 9.2 / CVSS v3.1 8.1) memory-corruption vulnerability in libssh2, a widely embedded C library that implements the client side of the SSH-2 protocol and is bundled by curl/libcurl, backup utilities, network-management tooling, and a large number of IoT, router, NAS, and industrial-controller firmware images.

The defect lives in ssh2_transport_read() in transport.c. When libssh2 reads an incoming SSH binary packet it parses the 4-byte big-endian packet_length field but does not validate it against an internal maximum (LIBSSH2_PACKET_MAXPAYLOAD) before using it in allocation arithmetic. An attacker who controls the remote SSH endpoint (a malicious server that a libssh2 client connects to, or an on-path man-in-the-middle) can set packet_length to a very large value such as 0xffffffff. In the vulnerable allocation path the computed total (conceptually total_num = 4 + packet_length + mac_len + auth_len) wraps modulo 2^32 — for example 0xffffffff + 0 + 16 wraps to 15, so libssh2 allocates a tiny heap buffer (≈19 bytes) instead of the intended large region. Subsequent packet processing still references the original oversized packet_length and copies far more data than the undersized buffer can hold, producing an out-of-bounds heap write that corrupts adjacent heap structures.

Because the bug is reached during the SSH transport/key-exchange phase, exploitation occurs PRE-AUTHENTICATION with no credentials and no user interaction. The consequences range from a reliable denial of service (process crash) to potential remote code execution, depending on heap layout and platform; the upstream project addressed both a code-execution path (commit 97acf3df) and a related denial-of-service path (commit 1762685). A separate companion issue, CVE-2026-55199, was fixed in the same area.

The vulnerability was responsibly disclosed by security researcher Tristan Madani (@TristanInSec); the fix was implemented by contributor willco007 in PR #2052 and adds strict bounds checking that rejects packets whose packet_length exceeds the maximum allowed payload (returning LIBSSH2_ERROR_OUT_OF_BOUNDARY). At disclosure there was no confirmed in-the-wild exploitation and EPSS was low (~0.6% 30-day), but proof-of-concept components demonstrating the integer wrap and a controlled heap-exploitation harness were published, and the no-auth network vector makes this a high-priority patch for any product that statically links or bundles libssh2.

## MITRE ATT&CK

- T1588 Obtain Capabilities
- T1587 Develop Capabilities
- T1583 Acquire Infrastructure
- T1190 Exploit Public-Facing Application
- T1133 External Remote Services
- T1203 Exploitation for Client Execution
- T1059 Command and Scripting Interpreter
- T1212 Exploitation for Credential Access
- T1210 Exploitation of Remote Services
- T1211 Exploitation for Stealth
- T1573 Encrypted Channel
- T1071 Application Layer Protocol
- T1199 Trusted Relationship
- T1557 Adversary-in-the-Middle
- T1608 Stage Capabilities
- T1499 Endpoint Denial of Service

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**libssh2 CVE-2026-55200 — Oversized Pre-Auth SSH packet_length During Key Exchange (Exploitation)** (`TL-2026-0931-SPL-001`)

Detects the core CVE-2026-55200 exploitation signature: an inbound SSH binary packet whose 4-byte big-endian packet_length field exceeds LIBSSH2_PACKET_MAXPAYLOAD (262144) is delivered to a libssh2-based client during the pre-authentication transport/key-exchange phase. In the vulnerable code path this value (e.g. 0xffffffff) wraps the allocation arithmetic (4 + packet_length + mac_len + auth_len mod 2^32) and under-allocates the heap buffer, producing an out-of-bounds heap write. This rule correlates network IDS/Zeek packet-length telemetry with the SSH service to alert on anomalous key-exchange-phase packet sizes.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1190, T1203, T1557
- **Data sources:** zeek_ssh, suricata_ssh, network_ids, commonsecuritylog
- **Severity:** critical
- **Confidence:** high

### Splunk SPL

```spl
index=network sourcetype="bro:ssh:json" OR sourcetype="suricata:ssh"
| eval pkt_len=coalesce(packet_length, ssh.packet_length, alert.packet_length)
| where isnotnull(pkt_len) AND pkt_len > 262144
| eval kex_phase=if(auth_attempts=0 OR isnull(auth_success), "pre-auth", "post-auth")
| search kex_phase="pre-auth"
| stats count min(_time) as first_seen max(_time) as last_seen values(server) as remote_ssh_endpoint values(pkt_len) as observed_packet_lengths by src_ip dest_ip
| where count >= 1
| eval signature="CVE-2026-55200 libssh2 oversized pre-auth packet_length (integer-overflow-to-OOB-write)"
| table first_seen last_seen src_ip dest_ip remote_ssh_endpoint observed_packet_lengths count signature
```

### Microsoft KQL

```kql
// Fallback KQL for environments mirroring Zeek/Suricata SSH logs into Sentinel
CommonSecurityLog
| where TimeGenerated > ago(24h)
| where DeviceProduct has_any ("Zeek", "Suricata", "Bro")
| where Protocol == "SSH" or DestinationPort == 22
| extend PacketLength = toint(extract(@"packet_length\"?\s*[:=]\s*(\d+)", 1, AdditionalExtensions))
| where PacketLength > 262144
| project TimeGenerated, SourceIP, DestinationIP, DestinationPort, PacketLength, DeviceProduct
| summarize Count=count(), MaxPacketLength=max(PacketLength), FirstSeen=min(TimeGenerated) by SourceIP, DestinationIP
```

### Sigma

```yaml
title: libssh2 CVE-2026-55200 Oversized SSH packet_length During Key Exchange
id: 6f3a1c2e-9d44-4b7a-8e21-0931a5b001cc
status: experimental
description: Detects an SSH binary packet with packet_length exceeding LIBSSH2_PACKET_MAXPAYLOAD during the pre-authentication key-exchange phase, the network signature of CVE-2026-55200 integer-overflow-to-heap-OOB-write in libssh2 ssh2_transport_read().
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-55200
  - https://github.com/advisories/GHSA-r8mh-x5qv-7gg2
  - https://github.com/libssh2/libssh2/pull/2052
author: Threadlinqs Team
date: 2026/06/24
tags:
  - attack.initial_access
  - attack.t1190
  - attack.execution
  - attack.t1203
  - attack.collection
  - attack.t1557
  - cve.2026.55200
logsource:
  category: network_connection
  product: zeek
  service: ssh
detection:
  selection:
    packet_length|gte: 262145
  phase:
    auth_success: false
  condition: selection and phase
falsepositives:
  - Misparsed or fragmented SSH frames in IDS reassembly
  - Custom SSH tooling that legitimately negotiates very large payloads (rare)
level: critical
```

**Known false positives:**

- IDS frame-reassembly artifacts producing inflated length fields
- Non-standard SSH implementations negotiating unusually large payloads

**Tuning notes:** Tune the 262144 threshold to your LIBSSH2_PACKET_MAXPAYLOAD build value; allowlist known internal SSH appliances that legitimately use large channel windows. If your IDS does not parse packet_length, deploy a Zeek script to extract the 4-byte big-endian length immediately after the SSH banner.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- libssh2 CVE-2026-55200 — Outbound SSH from libssh2-Linked Process (Exploitation Reach) (locked: unlock with TL Creds)
- libssh2 CVE-2026-55200 — Heap-Corruption Abend of SSH Client (Post-Exploitation) (locked: unlock with TL Creds)
- libssh2 CVE-2026-55200 — Internal Lateral SSH Over Encrypted Channel from Compromised Client (Lateral Movement) (locked: unlock with TL Creds)
- libssh2 CVE-2026-55200 — Integer-Wrap packet_length Signature on SSH Key Exchange (Exploitation) (locked: unlock with TL Creds)
- libssh2 CVE-2026-55200 — Linux SSH Client SIGSEGV/Heap-Abort During Key Exchange (Post-Exploitation) (locked: unlock with TL Creds)
- libssh2 CVE-2026-55200 — Malicious-Server Banner with Oversized First Packet (C2 / MITM Channel) (locked: unlock with TL Creds)
- libssh2 CVE-2026-55200 — SSH Client Crash / Heap Abort During Key Exchange (Post-Exploitation) (locked: unlock with TL Creds)
- libssh2 CVE-2026-55200 — Outbound SSH from libssh2 Client to Untrusted/External Endpoint (C2 / Lateral Movement) (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (3 of 20)

Defanged, TLP:CLEAR.

- File hash: `97acf3dfda80c91c3a8c9f2372546301d4a1a7a8`
- File hash: `0c76580b200e2c42e710879f9a8da14e27d8856f`
- File hash: `943e45c7bd6f5ec3ec7bcf056e68b0b1ed77970b`

Full set of 20 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [NVD - CVE-2026-55200](https://nvd.nist.gov/vuln/detail/CVE-2026-55200)
- [GitHub Advisory Database - GHSA-r8mh-x5qv-7gg2](https://github.com/advisories/GHSA-r8mh-x5qv-7gg2)
- [libssh2 fix commit 97acf3dfda80c91c3a8c9f2372546301d4a1a7a8](https://github.com/libssh2/libssh2/commit/97acf3dfda80c91c3a8c9f2372546301d4a1a7a8)
- [libssh2 PR #2052 - Add additional bounds checking on packet length](https://github.com/libssh2/libssh2/pull/2052)
- [VulnCheck Advisory - libssh2 out-of-bounds write via unchecked packet length in transport.c](https://www.vulncheck.com/advisories/libssh2-out-of-bounds-write-via-unchecked-packet-length-in-transport-c)
- [Cyber Security News - libssh2 Vulnerability Lets Attackers Trigger Out-of-Bounds Heap Write (CVE-2026-55200)](https://cybersecuritynews.com/libssh2-vulnerability/)
- [The CyberSec Guru - CVE-2026-55200: Critical libssh2 RCE Flaw Affects All Versions](https://thecybersecguru.com/news/cve-2026-55200-libssh2-remote-code-execution/)
- [Cyber Kendra - CVE-2026-55200 Critical libssh2 Flaw Enables Zero-Auth RCE](https://www.cyberkendra.com/2026/06/cve-2026-55200-critical-libssh2-flaw.html)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-0931
