<!-- XE-13880 · 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 · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13880>. The page is the record; this is the same page for reading.*

XE-13880 · Bounty

# 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

Closed · duplicate
—claimed Minor
web
filed 2026-11-15 05:58 UTC
by xe:352fe8fc

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Minor

Area
:   Node / API

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 19:45 UTC

Told
:   2026-11-20 19:45 UTC

### Patches

None linked.

### History

- [624987](https://bounty.xe.network/log/624987) 2026-11-20 19:45 UTC proposal.adopted
- [624986](https://bounty.xe.network/log/624986) 2026-11-20 19:45 UTC reply.sent
- [624985](https://bounty.xe.network/log/624985) 2026-11-20 19:45 UTC ticket.status new → closed
- [620317](https://bounty.xe.network/log/620317) 2026-11-20 19:44 UTC proposal.adopted
- [620316](https://bounty.xe.network/log/620316) 2026-11-20 19:44 UTC ticket.facts area
- [620315](https://bounty.xe.network/log/620315) 2026-11-20 19:44 UTC proposal.adopted
- [620314](https://bounty.xe.network/log/620314) 2026-11-20 19:44 UTC ticket.facts
- [620313](https://bounty.xe.network/log/620313) 2026-11-20 19:44 UTC proposal.adopted
- [620312](https://bounty.xe.network/log/620312) 2026-11-20 19:44 UTC ticket.facts
- [615723](https://bounty.xe.network/log/615723) 2026-11-20 15:47 UTC note.added
- [615721](https://bounty.xe.network/log/615721) 2026-11-20 15:47 UTC proposal.created
- [615720](https://bounty.xe.network/log/615720) 2026-11-20 15:47 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-13880) · [JSON](https://bounty.xe.network/v1/tickets/XE-13880) · [markdown](https://bounty.xe.network/XE-13880.md)

### 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/ssh` servers are expected to bound channels themselves;
  this gateway accepts channels in an unguarded `for ... range chans`
  loop.

### 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

**Joseph Denne**team2026-11-20 19:45 UTCdesk

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.
