Tunnel handshake accepts any peer — leaseHash is the only credential
Report
What happens
ValidateTunnelLease in node/node.go (~line 2176) takes a peerID param but never looks at it:
go func (n *Node) ValidateTunnelLease(leaseHash string, peerID peer.ID) error { lease := n.GetLease(leaseHash) if lease == nil { return fmt.Errorf("lease not found") } if lease.State != core.LeaseAccepted { return fmt.Errorf("lease not active") } if lease.Provider != n.KeyPair.Address() { return fmt.Errorf("not the provider for this lease") } return nil } (1/2)
It also never checks the caller is lease.Account — the consumer who is actually paying for the lease. And lease hashes are public data (they're on the lattice via gossip/explorer).
So in net/tunnel.go SetupTunnelHandler, any libp2p peer who knows a lease hash gets a raw TCP tunnel dialed to the provider VM's SSH port. The caller's s.Conn().RemotePeer() is passed in and then ignored.
Impact
Not an SSH key bypass — the consumer's access key still protects the shell itself. But it turns the SSH gateway into an open relay for anyone with a public lease hash:
- port exposure / service discovery on provider VMs
- free brute-force and recon surface against the SSH daemon
- arbitrary traffic relayed through providers (they eat the bandwidth)
- a way to hold tunnels open on purpose (TunnelRegistry + DialSSH per attempt = DoS-ish)
Lands under "provider VMs and the SSH gateway" in scope. Tier Medium-ish since the crypto still holds.
Repro
End to end needs a testnet provider node, but the code path is short:
- pick any lease in
LeaseAcceptedstate, copy itsLeaseHash(public) - from any peer:
xenet.OpenTunnel(ctx, host, dht, providerPeerID, leaseHash) - provider calls
ValidateTunnelLease(leaseHash, remotePeer)-> returns nil regardless of who you are DialSSHruns and your stream is piped to the VM's port 22
A one-line check like if peerID != n.PeerForAccount(lease.Account) { return err } would close the gap.
Happy to put together a live repro against testnet if useful.
Thread
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, reply with what differs and we will look again.