<!-- XE-11928 · SSH gateway binds 0.0.0.0 with no localhost-only option · testnet -->
*Markdown view of <https://bounty.xe.network/XE-11928>. The page is the record; this is the same page for reading.*

XE-11928 · Bounty

# SSH gateway binds 0.0.0.0 with no localhost-only option

Closed · duplicate
—claimed Minor
web
filed 2026-11-13 11:18 UTC
by xe:75fb54b9

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Minor

Area
:   Node / API

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:50 UTC

Told
:   2026-11-20 00:50 UTC

### Patches

None linked.

### History

- [559342](https://bounty.xe.network/log/559342) 2026-11-20 00:50 UTC proposal.adopted
- [559341](https://bounty.xe.network/log/559341) 2026-11-20 00:50 UTC reply.sent
- [559340](https://bounty.xe.network/log/559340) 2026-11-20 00:50 UTC ticket.status new → closed
- [558590](https://bounty.xe.network/log/558590) 2026-11-20 00:49 UTC proposal.adopted
- [558587](https://bounty.xe.network/log/558587) 2026-11-20 00:49 UTC proposal.adopted
- [558586](https://bounty.xe.network/log/558586) 2026-11-20 00:49 UTC ticket.facts
- [558584](https://bounty.xe.network/log/558584) 2026-11-20 00:49 UTC proposal.adopted
- [558583](https://bounty.xe.network/log/558583) 2026-11-20 00:49 UTC ticket.facts
- [555876](https://bounty.xe.network/log/555876) 2026-11-20 00:45 UTC note.added
- [555875](https://bounty.xe.network/log/555875) 2026-11-20 00:45 UTC proposal.created
- [555874](https://bounty.xe.network/log/555874) 2026-11-20 00:45 UTC proposal.created
- [555873](https://bounty.xe.network/log/555873) 2026-11-20 00:45 UTC proposal.created

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

### Report

## SSH gateway binds 0.0.0.0 with no localhost-only option (the only non-restrictable listener)

### What

`cmd/xe/main.go:1421-1422`:

```
sshPort := flags.Int("ssh-port", 0, "SSH gateway port (0 = disabled)")
...
sshAddr := fmt.Sprintf("0.0.0.0:%d", *sshPort)
gw, err := node.NewSSHGateway(sshAddr, *data, n)
```

`NewSSHGateway` (`node/ssh_gateway.go:41`) does a bare `net.Listen("tcp", "0.0.0.0:PORT")`. There is
**no bind-address flag** — the SSH gateway always listens on every interface. The API/UI/ops
servers all take an `apiBind`/`uiBind` host (with an explicit `0.0.0.0`/`::` check at `:1510`),
but the SSH gateway is the one listener with no host option, so an operator who wants the gateway
to be LAN-only or loopback-only **cannot** — enabling `--ssh-port` exposes it on all interfaces,
including the WAN face of a residential / VPS provider node.

### Impact

A provider node with `--ssh-port` set exposes its SSH/lease-tunnel gateway on every interface with
no way to restrict it to loopback/LAN. Combined with the per-IP connection caps (`maxConnsPerIP`),
it's still a broader exposure than the operator may intend, and there's no config to tighten it.

### Fix

Add a `--ssh-bind` (or reuse the `apiBind` host) for the SSH gateway, defaulting to `127.0.0.1`,
and only bind `0.0.0.0` when explicitly requested.

### Thread

**Joseph Denne**team2026-11-20 00:50 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-11928 and says what differs; it is read like any other.
