{"id":"XE-0122","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"198","source_url":"https://github.com/xeprotocol/xe/issues/198","reporter_id":39,"title":"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)","area":"p2p-sync","claimed_tier":"medium","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-10-29T16:51:36.771418+00:00","updated_at":"2026-11-08T20:17:41.885067+00:00","source_created_at":"2026-10-29T16:51:17+00:00","told_at":"2026-11-08T20:18:50.472488+00:00","status_changed_at":"2026-11-08T20:18:36.927594+00:00","url":"https://bounty.xe.network/XE-0122","body":"**Suggested severity: Medium (2,500 XE)**\n**Area:** `net/netcheck.go` (dial filter), `net/discovery.go` (dial of advertised addrs)\n**Repo pin:** 9787859 (testnet-0005)\n\n## Summary\n\nThe gater accepts every dial target:\n\n```go\n// net/netcheck.go:298-300\nfunc (g *NetworkGater) InterceptAddrDial(_ peer.ID, _ ma.Multiaddr) bool {\n\treturn true\n}\n```\n\n`AmbientDiscovery` dials whatever multiaddrs come back from the rendezvous namespace it reads:\n\n```go\n// net/discovery.go:107-127\nfor pi := range ch {\n\t...\n\tdialCtx, dcancel := context.WithTimeout(ctx, discoveryDialTimeout)\n\terr := a.host.Connect(dialCtx, pi)   // pi.Addrs is entirely peer-supplied\n```\n\nA 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.\n\n## PoC (executed)\n\n```\nInterceptAddrDial(/ip4/169.254.169.254/tcp/80) = true\nInterceptAddrDial(/ip4/10.0.0.5/tcp/22)        = true\nFindPeer(attacker) -> addrs=[/ip4/127.0.0.1/tcp/37427]\nvictim dial -> internal endpoint hit: 32 bytes   (libp2p multistream handshake)\n```\n\nA listener on loopback received the connection and the multistream handshake, i.e. the dial actually left the node toward an address the peer selected.\n\n## Impact\n\n- 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).\n- 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).\n- 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.\n\n## Suggested fix\n\nReject 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.\n","patch_refs":[{"id":206,"repo":"xeprotocol/xe","kind":"pr","ref":"206","title":"fix(net): filter non-routable dial addresses to prevent blind SSRF and port probing (fixes #198)","url":"https://github.com/xeprotocol/xe/pull/206","note":"","state":"open","author":"NePreby","added_by":"desk","created_at":"2026-10-29T17:32:43.498644+00:00"}],"thread":[{"id":1599,"source":"desk","source_ref":"reply:718","author":"Joseph Denne","team":true,"body":"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.","created_at":"2026-11-08T20:17:41.885067+00:00"}]}