node: SSH gateway has no per-connection channel limit — one authenticated connection can open unbounded direct-tcpip channels, bypassing the 100-connection cap and exhausting tunnel resources
Report
Verification: surfaced by an independent second-opinion model review of the public source and then verified line-by-line by direct code trace against xeprotocol/xe @ 89a542ea51d38375299aee54c6c99102e9bfa666 (static verification; no dynamic PoC). Key code excerpts are attached as evidence.
Summary
maxSSHConnections bounds concurrent TCP connections to the gateway
at 100, but nothing bounds SSH channels within one connection. A
client holding any accepted lease and its SSH access key opens a
single connection and then opens direct-tcpip channels without
limit, keeping them open. Each accepted channel consumes a handler
goroutine, a backend tunnel to the provider peer (libp2p stream via
OpenTunnel), and two copy goroutines. The attacker multiplies
resource consumption by orders of magnitude beyond what the
connection cap was designed to allow, exhausting gateway goroutines,
memory, or provider tunnel capacity and degrading the gateway for
other users.
Reachability — stated plainly
- Prerequisite: one accepted lease with an SSH access key (the normal customer credential). The attack runs entirely inside one authenticated connection, so per-connection accounting never sees it.
x/crypto/sshservers are expected to bound channels themselves; this gateway accepts channels in an unguardedfor ... range chansloop.
Suggested fix
Add a per-connection channel semaphore (and ideally a per-lease tunnel
cap) in handleConnection: reject new direct-tcpip channels once a
connection holds a bounded number of concurrent channels.
Dedupe
Not among our 16 filed tickets (XE-12911..XE-13213). Phase 2 explicitly named the SSH-gateway side of leasing unexplored (AUDIT-PHASE2.md). Distinct from XE3-DRAFT-SSH1 (pre-auth slot exhaustion by unauthenticated clients); this item is post-auth and per-channel.
Thread
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-13880 and says what differs; it is read like any other.