<!-- XE-13229 · [Medium] ValidateTunnelLease ignores the connecting peer — any network peer can open a raw TCP tunnel into any active lease's VM · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13229>. The page is the record; this is the same page for reading.*

XE-13229 · Bounty

# \[Medium\] ValidateTunnelLease ignores the connecting peer — any network peer can open a raw TCP tunnel into any active lease's VM

Closed · duplicate
—claimed Medium
[xe#355](https://github.com/xeprotocol/xe/issues/355)
filed 2026-11-11 07:43 UTC
by urelkdubdqwr

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Medium

Area
:   Node / API

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

Tracked
:   internally

Updated
:   2026-11-20 00:07 UTC

Told
:   2026-11-20 00:04 UTC

### Patches

None linked.

### History

- [543850](https://bounty.xe.network/log/543850) 2026-11-20 00:06 UTC github.state\_pushed
- [543847](https://bounty.xe.network/log/543847) 2026-11-20 00:06 UTC github.labels
- [542870](https://bounty.xe.network/log/542870) 2026-11-20 00:04 UTC reply.mirrored
- [542601](https://bounty.xe.network/log/542601) 2026-11-20 00:04 UTC proposal.adopted
- [542600](https://bounty.xe.network/log/542600) 2026-11-20 00:04 UTC reply.sent
- [542599](https://bounty.xe.network/log/542599) 2026-11-20 00:04 UTC ticket.status new → closed
- [540298](https://bounty.xe.network/log/540298) 2026-11-20 00:03 UTC proposal.adopted
- [540297](https://bounty.xe.network/log/540297) 2026-11-20 00:03 UTC ticket.facts area
- [540296](https://bounty.xe.network/log/540296) 2026-11-20 00:03 UTC proposal.adopted
- [540295](https://bounty.xe.network/log/540295) 2026-11-20 00:03 UTC ticket.facts
- [540294](https://bounty.xe.network/log/540294) 2026-11-20 00:03 UTC proposal.adopted
- [540293](https://bounty.xe.network/log/540293) 2026-11-20 00:03 UTC ticket.facts

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

### Report

# \[Medium\] ValidateTunnelLease ignores the connecting peer — any network peer can open a raw TCP tunnel into any active lease's VM

**Severity (suggested):** Medium (up to 2,500 XE) — pre-auth network reachability of a tenant VM \+ unbounded per-peer stream DoS

## Root cause

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

## Impact

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

## Steps to reproduce

1. `GET https://test.network/leases` → pick any `Accepted` lease whose provider runs a VM backend.
2. From an arbitrary libp2p peer, open a `/xe/tunnel/2.0.0` stream to the provider and send the 32-byte lease hash.
3. Observe status `0x00` and a live bidirectional pipe to the VM's SSH port — the consumer's identity is never validated.

## Fix direction

In `ValidateTunnelLease`, require `peerID == n.PeerForAccount(lease.Consumer)` (mirror the consumer-side binding).

### Thread

**urelkdubdqwr**2026-11-11 07:48 UTCgithub

XE payout address for this finding: `10b3dcf69edda38c4b579ade45e0bb110c04ce7215837d8f0b784916d5a50405`

**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-13229 and says what differs; it is read like any other.
