{"id":"XE-13246","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"375","source_url":"https://github.com/xeprotocol/xe/issues/375","reporter_id":1343,"title":"[High] libp2p tunnel path bypasses consumer authentication — any peer can open a raw stream to any accepted lease's VM","area":"node-api","claimed_tier":"high","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:03.375135+00:00","updated_at":"2026-11-20T00:06:16.571102+00:00","source_created_at":"2026-11-11T12:02:19+00:00","told_at":"2026-11-20T00:04:20.900153+00:00","status_changed_at":"2026-11-20T00:04:20.885896+00:00","url":"https://bounty.xe.network/XE-13246","body":"## Summary\n\n`ValidateTunnelLease` (`node/node.go:2176-2189`) never uses its `peerID` parameter: it checks only lease existence, `LeaseAccepted` state, and that the node is the provider. The HTTP tunnel path requires `X-Signature` over the lease hash verified against `lease.AccessPubKey` (`api/tunnel.go:36-48`); the libp2p `/xe/tunnel/2.0.0` stream path requires nothing. Lease hashes are public (`GET /leases`, gossip), so any libp2p peer can open a raw TCP pipe to any leased VM's sshd (fingerprinting, SSH attack surface, auth-attempt oracle; shell access still gated by sshd `authorized_keys` — hence High, not Critical).\n\n## Reproduction (full PoC: `poc-f5.md`)\n\nLocal 2-node devnet, private genesis, stock binary. Provider + consumer lease `70954c57…` **accepted** (consumer `d8349ec8…`, provider `df137ba7…`, cost 0.002584 XUSD). A bare libp2p probe (random identity, netcheck handshake OK) wrote only the 32-byte lease hash:\n\n- Real hash → `0x01 \"mock manager does not support SSH\"` — passed `ValidateTunnelLease`, failed only at the mock VM backend.\n- Unknown hash → `0x01 \"lease not found\"` — failed at validation.\n- Provider log confirms the two distinct branches.\n- HTTP `POST /tunnel/{hash}/tcp` without `X-Signature` → `401 {\"error\": \"missing X-Signature header\"}` (404 for unknown lease).\n\nA second in-process run (real `node.Node` ×2, real `SetupTunnelHandler` / `ValidateTunnelLease` / `OpenTunnel`, VM backend stubbed with a canned SSH banner because the stock mock manager refuses SSH dials and there is no KVM here) showed the attacker node (≠ consumer) receiving status `0x00` and reading the banner `SSH-2.0-OpenSSH_9.6p1 F5-PoC`, with its SSH client hello arriving at the VM endpoint through the tunnel. No shell was obtained or attempted.\n\n## Fix direction\n\nVerify the same lease-hash signature against `AccessPubKey` on the libp2p path, or bind the stream to the consumer's peer identity recorded at accept time.\n\nMy XE address for any reward: 5422b32c07cf2b2ca53b00c2073be5a895dae3fdf13645c05ebdd1c08864cf8f\n\n— @agngmarley\n\n[poc-f5.md](https://github.com/user-attachments/files/34686454/poc-f5.md)","patch_refs":[],"thread":[{"id":12508,"source":"github","source_ref":"7025789749","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-13246 and says what differs; it is read like any other.","created_at":"2026-11-20T00:04:23+00:00"}]}