<!-- XE-0122 · net: no dial-address filtering — a peer's advertised multiaddr makes the node connect to loopback/private/link-local addresses (blind SSRF / internal port probe) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0122>. The page is the record; this is the same page for reading.*

XE-0122 · Bounty

# net: no dial-address filtering — a peer's advertised multiaddr makes the node connect to loopback/private/link-local addresses (blind SSRF / internal port probe)

Triaging
claimed Medium
[xe#198](https://github.com/xeprotocol/xe/issues/198)
filed 2026-10-29 16:51 UTC
by hayokakoweda75

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Medium

Area
:   P2P / sync

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-08 20:17 UTC

Told
:   2026-11-08 20:18 UTC

### Patches

- [xe#206](https://github.com/xeprotocol/xe/pull/206) open by NePreby
  fix(net): filter non-routable dial addresses to prevent blind SSRF and port probing (fixes #198)

### History

- [43820](https://bounty.xe.network/log/43820) 2026-11-08 20:19 UTC reply.mirror\_failed
- [43781](https://bounty.xe.network/log/43781) 2026-11-08 20:18 UTC proposal.adopted
- [43780](https://bounty.xe.network/log/43780) 2026-11-08 20:18 UTC reply.sent
- [43235](https://bounty.xe.network/log/43235) 2026-11-08 20:18 UTC proposal.adopted
- [43234](https://bounty.xe.network/log/43234) 2026-11-08 20:18 UTC ticket.facts area
- [43233](https://bounty.xe.network/log/43233) 2026-11-08 20:18 UTC proposal.adopted
- [43232](https://bounty.xe.network/log/43232) 2026-11-08 20:18 UTC ticket.facts
- [43231](https://bounty.xe.network/log/43231) 2026-11-08 20:18 UTC proposal.adopted
- [43230](https://bounty.xe.network/log/43230) 2026-11-08 20:18 UTC ticket.facts
- [43229](https://bounty.xe.network/log/43229) 2026-11-08 20:18 UTC proposal.adopted
- [43228](https://bounty.xe.network/log/43228) 2026-11-08 20:18 UTC ticket.facts
- [43227](https://bounty.xe.network/log/43227) 2026-11-08 20:18 UTC proposal.adopted

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

### Report

**Suggested severity: Medium (2,500 XE)**
**Area:** `net/netcheck.go` (dial filter), `net/discovery.go` (dial of advertised addrs)
**Repo pin:** 9787859 (testnet-0005)

## Summary

The gater accepts every dial target:

```
// net/netcheck.go:298-300
func (g *NetworkGater) InterceptAddrDial(_ peer.ID, _ ma.Multiaddr) bool {
	return true
}
```

`AmbientDiscovery` dials whatever multiaddrs come back from the rendezvous namespace it reads:

```
// net/discovery.go:107-127
for pi := range ch {
	...
	dialCtx, dcancel := context.WithTimeout(ctx, discoveryDialTimeout)
	err := a.host.Connect(dialCtx, pi)   // pi.Addrs is entirely peer-supplied
```

A peer record is self-signed, so the `Addrs` list can contain `/ip4/127.0.0.1/...`, `/ip4/10.0.0.0/8`, `/ip4/192.168.0.0/16` or `/ip4/169.254.169.254/...`. Nothing between `FindPeers` and `Connect` inspects the address, and `InterceptAddrDial` returns `true` for all of them. The node therefore opens TCP connections *from its own network position* to targets chosen by an unauthenticated peer — a blind SSRF / internal port probe.

## PoC (executed)

```
InterceptAddrDial(/ip4/169.254.169.254/tcp/80) = true
InterceptAddrDial(/ip4/10.0.0.5/tcp/22)        = true
FindPeer(attacker) -> addrs=[/ip4/127.0.0.1/tcp/37427]
victim dial -> internal endpoint hit: 32 bytes   (libp2p multistream handshake)
```

A listener on loopback received the connection and the multistream handshake, i.e. the dial actually left the node toward an address the peer selected.

## Impact

- Reachability oracle for the node's private network: an attacker learns which internal hosts/ports accept TCP, one dial at a time, from the victim's own position (bypassing the attacker's own network restrictions).
- Any internal service that answers before libp2p negotiation completes sees a connection/request from the node (log poisoning, triggering side effects on GET-style endpoints is protocol-dependent; the handshake itself is fixed bytes, so this is not a data-exfiltration primitive).
- On cloud hosts, link-local `169.254.169.254` is dialable, which is the classic metadata target even though the payload here is not an HTTP request.

## Suggested fix

Reject non-globally-routable addresses in `InterceptAddrDial` (loopback, RFC1918, link-local, ULA, unspecified, multicast), or filter `AddrInfo.Addrs` in the discovery loop before dialing. Keep an explicit allowlist for the private test networks that need it, and add a test that a record advertising `127.0.0.1` / `169.254.169.254` is never dialed.

### Thread

**Joseph Denne**team2026-11-08 20:17 UTCdesk

Thanks for the report. We have confirmed the behaviour you describe in the node's peer-dialing path and it is being handled; we will update this ticket when the fix is in.
