<!-- XE-13246 · [High] libp2p tunnel path bypasses consumer authentication — any peer can open a raw stream to any accepted lease's VM · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13246>. The page is the record; this is the same page for reading.*

XE-13246 · Bounty

# \[High\] libp2p tunnel path bypasses consumer authentication — any peer can open a raw stream to any accepted lease's VM

Closed · duplicate
—claimed High
[xe#375](https://github.com/xeprotocol/xe/issues/375)
filed 2026-11-11 12:02 UTC
by agung marley

Verdict
:   Duplicate

Tier
:   —

Claimed
:   High

Area
:   Node / API

Duplicate of
:   [XE-0015](https://bounty.xe.network/XE-0015) fixing

Tracked
:   internally

Updated
:   2026-11-20 00:06 UTC

Told
:   2026-11-20 00:04 UTC

### Patches

None linked.

### History

- [543824](https://bounty.xe.network/log/543824) 2026-11-20 00:06 UTC github.state\_pushed
- [543823](https://bounty.xe.network/log/543823) 2026-11-20 00:06 UTC github.labels
- [542771](https://bounty.xe.network/log/542771) 2026-11-20 00:04 UTC reply.mirrored
- [542592](https://bounty.xe.network/log/542592) 2026-11-20 00:04 UTC proposal.adopted
- [542591](https://bounty.xe.network/log/542591) 2026-11-20 00:04 UTC reply.sent
- [542590](https://bounty.xe.network/log/542590) 2026-11-20 00:04 UTC ticket.status new → closed
- [540275](https://bounty.xe.network/log/540275) 2026-11-20 00:03 UTC proposal.adopted
- [540274](https://bounty.xe.network/log/540274) 2026-11-20 00:03 UTC ticket.facts area
- [540273](https://bounty.xe.network/log/540273) 2026-11-20 00:03 UTC proposal.adopted
- [540272](https://bounty.xe.network/log/540272) 2026-11-20 00:03 UTC ticket.facts
- [540271](https://bounty.xe.network/log/540271) 2026-11-20 00:03 UTC proposal.adopted
- [540270](https://bounty.xe.network/log/540270) 2026-11-20 00:03 UTC ticket.facts

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

### Report

## Summary

`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).

## Reproduction (full PoC: `poc-f5.md`)

Local 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:

- Real hash → `0x01 "mock manager does not support SSH"` — passed `ValidateTunnelLease`, failed only at the mock VM backend.
- Unknown hash → `0x01 "lease not found"` — failed at validation.
- Provider log confirms the two distinct branches.
- HTTP `POST /tunnel/{hash}/tcp` without `X-Signature` → `401 {"error": "missing X-Signature header"}` (404 for unknown lease).

A 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.

## Fix direction

Verify 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.

My XE address for any reward: 5422b32c07cf2b2ca53b00c2073be5a895dae3fdf13645c05ebdd1c08864cf8f

— @agngmarley

[poc-f5.md](https://github.com/user-attachments/files/34686454/poc-f5.md)

### Thread

**Joseph Denne**team2026-11-20 00:04 UTCgithub

Thanks. This is the same finding as https://bounty.xe.network/XE-0015, 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-13246 and says what differs; it is read like any other.
