{"id":"XE-13229","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"355","source_url":"https://github.com/xeprotocol/xe/issues/355","reporter_id":1180,"title":"[Medium] ValidateTunnelLease ignores the connecting peer — any network peer can open a raw TCP tunnel into any active lease's VM","area":"node-api","claimed_tier":"medium","assessed_tier":null,"verdict":"duplicate","duplicate_of":"XE-0015","tracked":true,"internal_ref":"#1083","internal_url":"https://github.com/xeprotocol/core/issues/1083","status":"closed","closed_reason":"duplicate","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:01.171331+00:00","updated_at":"2026-11-20T00:07:03.592269+00:00","source_created_at":"2026-11-11T07:43:13+00:00","told_at":"2026-11-20T00:04:25+00:00","status_changed_at":"2026-11-20T00:04:21.035100+00:00","url":"https://bounty.xe.network/XE-13229","body":"# [Medium] ValidateTunnelLease ignores the connecting peer — any network peer can open a raw TCP tunnel into any active lease's VM\n\n**Severity (suggested):** Medium (up to 2,500 XE) — pre-auth network reachability of a tenant VM + unbounded per-peer stream DoS\n\n## Root cause\n`node/node.go:2176` `ValidateTunnelLease(leaseHash string, peerID peer.ID) error` takes `peerID` but never reads it. It only checks the lease exists, `State == LeaseAccepted`, and `lease.Provider == n.KeyPair.Address()`. There is no `PeerForAccount(lease.Consumer)` check. The consumer binding exists on the consumer side (`OpenTunnelForLease` resolves `PeerForAccount(lease.Provider)`, `node/node.go:2211`) but the mirror check on the provider side was never implemented — the parameter was added to the `TunnelValidator` interface (`net/tunnel.go:25`) and left unused.\n\n## Impact\nThe provider→VM SSH backend is reachable by any libp2p peer that knows a lease hash (lease hashes are public via `GET /leases`). This bypasses the consumer-only network scoping, enables TCP/port scanning of the VM behind the provider's host, and gives a cheap per-peer multi-stream DoS (`HandleTunnel` spawns unbounded copies per request).\n\n## Steps to reproduce\n1. `GET https://test.network/leases` → pick any `Accepted` lease whose provider runs a VM backend.\n2. From an arbitrary libp2p peer, open a `/xe/tunnel/2.0.0` stream to the provider and send the 32-byte lease hash.\n3. Observe status `0x00` and a live bidirectional pipe to the VM's SSH port — the consumer's identity is never validated.\n\n## Fix direction\nIn `ValidateTunnelLease`, require `peerID == n.PeerForAccount(lease.Consumer)` (mirror the consumer-side binding).\n","patch_refs":[],"thread":[{"id":3115,"source":"github","source_ref":"6790276983","author":"urelkdubdqwr","team":false,"body":"XE payout address for this finding: `10b3dcf69edda38c4b579ade45e0bb110c04ce7215837d8f0b784916d5a50405`","created_at":"2026-11-11T07:48:48+00:00"},{"id":12511,"source":"github","source_ref":"7025790271","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as https://bounty.xe.network/XE-0015, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-13229 and says what differs; it is read like any other.","created_at":"2026-11-20T00:04:25+00:00"}]}