Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-54700 Overview
CVE-2026-54700 is an input validation flaw [CWE-20] in the ConnectBot SSH Client Library (cbssh), a Kotlin SSH implementation built on Kaitai Struct and KStateMachine. Versions prior to 0.3.1 trust attacker-controlled inner byte lengths and element counts in SSH protocol messages without verifying they fit within the containing packet. A malicious or compromised SSH server can send a small malformed packet whose oversized length declarations force the Kaitai Struct Java runtime to attempt excessive memory allocation. The result is an uncaught OutOfMemoryError that terminates the client application process.
Critical Impact
A hostile SSH server can crash any client application using ConnectBot cbssh prior to 0.3.1 by returning a single malformed packet immediately after connection, with no authentication required.
Affected Products
- ConnectBot SSH Client Library (cbssh) versions prior to 0.3.1
- Applications embedding the Kaitai-based SSH protocol parser from cbssh
- Deployments using SSH agent forwarding are additionally exposed via malformed SSH-agent messages
Discovery Timeline
- 2026-10-13 - CVE-2026-54700 published to the National Vulnerability Database
- 2026-10-13 - Last updated in NVD database
- v0.3.1 - ConnectBot releases patched version via GitHub Release v0.3.1
Technical Details for CVE-2026-54700
Vulnerability Analysis
The ConnectBot cbssh library defines its SSH wire format using Kaitai Struct (.ksy) schemas. These schemas declare variable-length fields where the length prefix is read from the packet itself. Before the patch, the parser accepted any 32-bit length value without cross-checking it against the number of bytes actually remaining in the input stream.
When a server returns a packet whose declared inner length is far larger than the physical payload, the Java runtime responds by allocating a buffer sized to the attacker's declaration. For large declared sizes this exhausts the Java Virtual Machine (JVM) heap and raises java.lang.OutOfMemoryError. Because the error is not caught at the parser boundary, it propagates to the top of the thread and terminates the host process. The flaw yields availability loss only; no confidentiality or integrity impact has been demonstrated.
Root Cause
The root cause is missing bounds validation in two Kaitai Struct schemas: ascii_string.ksy and byte_string.ksy. Both types read a u4 length field and then request that many bytes without ensuring the value is bounded by _io.size - _io.pos. The parser trusts the attacker-supplied length to drive allocation and sizing.
Attack Vector
Exploitation requires a client to connect to an attacker-controlled or compromised SSH server. No authentication, user interaction beyond initiating the connection, or optional feature is needed on the general transport path. The SSH-agent variant of the attack additionally requires that the victim client has enabled SSH agent forwarding, allowing crafted agent messages to reach the vulnerable parser.
# Patch to protocol/src/main/resources/kaitai/ascii_string.ksy
- id: len
type: u4
valid:
- expr: _ <= 65535
+ expr: _ <= 65535 and _ <= _io.size - _io.pos
- id: value
type: str
size: len
# Patch to protocol/src/main/resources/kaitai/byte_string.ksy
seq:
- id: len_data
type: u4
+ valid:
+ expr: _ <= _io.size - _io.pos
- id: data
size: len_data
Source: GitHub Commit a08421f
Detection Methods for CVE-2026-54700
Indicators of Compromise
- Repeated application crashes in processes embedding cbssh immediately after an outbound SSH connection is established.
- JVM crash logs or application logs containing java.lang.OutOfMemoryError originating from Kaitai Struct runtime classes.
- Outbound SSH sessions to unfamiliar servers that terminate during the transport handshake rather than at authentication.
Detection Strategies
- Inventory applications and Android builds that depend on connectbot/cbssh and flag any version earlier than 0.3.1.
- Review Software Bill of Materials (SBOM) data for the cbssh protocol artifact and correlate against the GitHub advisory GHSA-ch3q-cw5r-f4hg.
- Alert on client processes that terminate abnormally within seconds of initiating TCP port 22 traffic to external hosts.
Monitoring Recommendations
- Collect JVM crash dumps and application exit telemetry from endpoints running SSH client software built on cbssh.
- Monitor egress SSH traffic to non-corporate destinations and correlate with process termination events on the originating host.
- Track dependency updates in CI/CD pipelines to ensure cbssh is pinned to 0.3.1 or later across all build variants.
How to Mitigate CVE-2026-54700
Immediate Actions Required
- Upgrade the ConnectBot SSH Client Library to version 0.3.1 or later in all consuming applications.
- Rebuild and redistribute Android or Kotlin applications that statically bundle cbssh so end-user installations receive the patched parser.
- Audit SSH agent forwarding configurations and disable forwarding where it is not strictly required.
Patch Information
The fix is delivered in GitHub Release v0.3.1, implemented via Pull Request #194 and commit a08421f. The patch adds valid.expr constraints to Kaitai Struct length fields so declared sizes are bounded by the remaining bytes in the input stream (_io.size - _io.pos). See the full advisory at GHSA-ch3q-cw5r-f4hg.
Workarounds
- Restrict outbound SSH connections to a vetted allowlist of trusted servers until the patch is deployed.
- Disable SSH agent forwarding in client configurations to remove the agent-message attack path.
- Where feasible, raise JVM heap limits only as a temporary measure; this does not eliminate the flaw and only widens the attacker's budget before the crash.
# Example Gradle dependency pin to the patched release
dependencies {
implementation("org.connectbot:cbssh:0.3.1")
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

