mediumVulnerability

GHSA-ch3q-cw5r-f4hg

## Summary The SSH protocol parser trusted attacker-controlled length and count fields without first checking that the declared values fit within the containing packet. When a client connects to a malicious or compromised SSH server, the server can send a small, malformed packet containing an inner field whose declared length is much larger than the packet itself. The Kaitai Struct Java runtime attempts to allocate a byte array using the declared length before it discovers that the input is truncated. A sufficiently large value can therefore cause excessive memory allocation or an uncaught `OutOfMemoryError`, potentially terminating the application process that uses the library. Applications that enable SSH agent forwarding have an additional attack path: the connected server can send malformed agent protocol messages containing the same class of oversized inner length. ## Details SSH uses unsigned 32-bit length prefixes for strings and other protocol structures. Before the fix, several Kaitai Struct definitions passed these lengths directly to generated parsing code. For example, the byte-string definition read a `uint32` followed by an array of that size without validating the size against the bytes remaining in the current stream. The SSH transport limits the size of an outer packet, but an inner field in that packet could still declare a length approaching the Java array size limit. The Kaitai runtime allocates the destination array before reading from the bounded input stream. Consequently, an attacker does not need to transmit an equally large packet to trigger the allocation attempt. Malformed count fields could also cause parsers to attempt an unreasonable number of repeated elements. The fix validates both byte lengths and element counts against the size of their containing stream. Parsing failures previously surfaced inconsistently as unchecked runtime exceptions. The fixed version converts malformed SSH packets to a transport protocol error and re

Properties

ghsa_id
GHSA-ch3q-cw5r-f4hg
severity
medium
summary
ConnectBot SSH Client Library: Unbounded SSH field lengths can cause excessive memory allocation
cve_id
GHSA-ch3q-cw5r-f4hg
is_ghsa_only
true
ghsa_published
2026-06-12T21:02:01Z
source_url
https://github.com/advisories/GHSA-ch3q-cw5r-f4hg
ghsa_updated
2026-06-12T21:02:02Z

Related Entities (5)

VULNERABLE_TO (1)

[Software]maven/org.connectbot.sshlib:sshlib

AFFECTS (1)

[Software]maven/org.connectbot.sshlib:sshlib

HAS_WEAKNESS (2)

[Weakness]Memory Allocation with Excessive Size Value
[Weakness]Improper Input Validation

REPORTED_BY (1)

[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph