SSH gateway binds 0.0.0.0 with no localhost-only option
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
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.