security(node,api,core): Unauthenticated VM Credential/Tunnel Access, Post-Expiry Lease Tunneling & Renewed Lease / Multi-Asset Accounting Flaws
Report
Disclosure Note: We attempted to report these findings privately to
security@xe.networkper the XE Bug Bounty Program guidelines, but the address bounced (no MX/recipient configured), and GitHub Private Vulnerability Reporting is not enabled onxeprotocol/xe. We are opening this report along with a companion Fix PR containing surgical patches and regression tests.
Summary
During a security audit of the xeprotocol/xe Track 1 modules (node/, api/, core/), we identified four High/Severe vulnerabilities affecting leased VM authentication/isolation, P2P/HTTP tunnel access control, renewed lease escrow/supply conservation, and multi-asset (XE / XUSD) ledger accounting:
| # | Severity | Component | Vulnerability |
|---|---|---|---|
| 1 | Severe | node/vm.go, api/handler.go |
Unauthenticated VM plaintext credential & status disclosure via P2P vm_status RPC and HTTP GET /vms, GET /vms/{lease} |
| 2 | Severe | node/node.go, api/tunnel.go, node/ssh_gateway.go |
Unauthenticated P2P /xe/tunnel/2.0.0 hijacking (ValidateTunnelLease ignores peerID) and post-expiry VM tunnel/SSH access |
| 3 | High | node/node.go, core/supply.go, core/ledger.go, core/types.go |
Broken BlockLeaseRenew accounting: unrecoverable consumer escrow on forceSettleLease, permanent XUSD supply conservation failure, missing per-lease lock & conflict staging failure |
| 4 | High | core/ledger.go, core/spendable.go, node/node.go |
Multi-asset (XE vs XUSD) balance corruption in Ledger.GetBalance, Node.GetAllAccounts, SpendableBalances, and conflict parentBalance calculation |
Finding 1: Unauthenticated VM Plaintext Credential & Status Disclosure (node/vm.go, api/handler.go)
Root Cause
- Unauthenticated P2P
vm_statusRPC (node/vm.go:40-55): When a lease is provisioned without anAccessPubKey(credential mode),VMManager.Provisiongenerates plaintext SSH credentials (vm.Credentials{Username, Password}) and stores them onvm.Info.Credentials. Unlikevm_credentials(node/vm.go:27-30, which verifiesproviderPeer == from), thevm_statusP2P handler (n.Msg.Handle("vm_status", ...)) performs no peer authorization and serializes the entirevm.Infostruct—including plaintextCredentials—to any requesting libp2p peer:n.Msg.Handle("vm_status", func(from peer.ID, payload json.RawMessage) (json.RawMessage, error) { ... info, err := n.VMManager.Get(req.LeaseHash) if err != nil { return nil, err } return json.Marshal(info) // leaks info.Credentials to any peer 'from' }) - Unauthenticated HTTP
GET /vms&GET /vms/{lease}(api/handler.go:200-201,node/vm.go:136-167):GET /vmsandGET /vms/{lease}are registered withouth.requireAdmin(...), exposing all localvm.Infostructs (including plaintextCredentials) to any unauthenticated HTTP client. Furthermore, whenGET /vms/{lease}is called for a lease not inconsumerVMs,Node.GetVM(leaseHash)(node/vm.go:156) queries the remote provider'svm_statusP2P RPC even if the local node is not the lease consumer.
Impact
Because leaseHash values are public on the DAG ledger, any libp2p peer or unauthenticated HTTP client can query any active credential-mode lease and obtain its plaintext SSH username and password.
Finding 2: Unauthenticated P2P /xe/tunnel/2.0.0 Hijacking & Post-Expiry VM Tunnel/SSH Access (node/node.go, api/tunnel.go, node/ssh_gateway.go)
Root Cause
ValidateTunnelLeaseIgnorespeerID(node/node.go:2176-2189): When a remote peer opens a/xe/tunnel/2.0.0stream (net/tunnel.go:70-128) and sends a 32-byteleaseHash, the provider invokesNode.ValidateTunnelLease(leaseHash string, peerID peer.ID). However,ValidateTunnelLeasecompletely ignorespeerIDand never checks whetherpeerIDmatchesn.PeerForAccount(lease.Consumer):
Any libp2p peer on the network can send the public 32-bytefunc (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 }leaseHashto/xe/tunnel/2.0.0and receive a raw TCP stream bridged directly to the VM's internal SSH port (DialSSH). Combined with Finding 1, any peer on the P2P network can take over any credential-mode VM.- Post-Expiry Tunnel & SSH Gateway Access (
node/node.go:2182, 2208,api/tunnel.go:25,node/ssh_gateway.go:121): A lease remains inlease.State == core.LeaseAcceptedafterlease.EffectiveExpiry()duringLeaseSettleGrace(1 hour) andLeaseForceSettleGap(+25 minutes), or up to 8 days (LeaseEscrowExpiry + LeaseArchiveGap) before archival. None ofValidateTunnelLease,OpenTunnelForLease,handleTunnelTCP, orSSHGateway.handleConnectioncheckslease.StartTime > 0 && core.Now().UnixNano() >= lease.EffectiveExpiry(), allowing continued SSH and TCP tunnel access after lease expiration.
Finding 3: Broken BlockLeaseRenew Accounting in Force-Settlement, Supply Conservation & Conflict Staging (node/node.go, core/supply.go, core/ledger.go, core/types.go)
Root Cause
- Consumer Cannot Force-Settle Renewed Leases (
node/node.go:1928-1940vscore/ledger.go:1969-1976): EachBlockLeaseRenewblock tops up the lease's pending escrow (commit.TopUpPendingID = b.Source,commit.TopUpPendingAmount = b.Amount), sopending.Amountequalslease.Cost + sum(renewals.Cost). Incore/ledger.go:1970,validateAndAddLeaseForceSettlerequiresb.Balance == oldBal + pending.Amount. However,Node.forceSettleLease(node/node.go:1934, 1938) setsb.Balance = oldXUSD + lease.Costandb.Amount = lease.Cost(ignoringlease.Renewals). Consequently,n.Ledger.AddBlock(b)rejects everyforceSettleLeaseattempt on a renewed lease withbalance mismatch, trapping the consumer's initial + renewal XUSD in escrow untilLeaseEscrowExpiryburns it. Additionally,validateAndAddLeaseForceSettledoes not validateb.Amount == pending.Amount. - Permanent XUSD Supply Conservation Failure on Renewed Lease Settle/Expiry (
core/supply.go:95-96, 213-215, 280-284):termsFromChainignoresBlockLeaseRenewblocks andwalk()only addsl.Cost(omittingl.Renewals[i].Cost) toEscrowBurnedwhen a lease settles or expires. BecauseBlockLeaseSettle/archiveExpiredLeasedeletes the entire topped-upPendingSend, settling or expiring any renewed lease causesSupplyAuditor.Report()(GET /supply) to permanently reportConserved: falsewith a negativeXUSDdiscrepancy equal to the sum of all renewal costs. - Missing Per-Lease Lock & Conflict Staging Support for
BlockLeaseRenew(core/ledger.go:492-498, 2779-2785):isLeaseStateTransitionomitsBlockLeaseRenew, soaddBlock(line 788) does not acquirel.acquireLeaseLock(b.Source)duringBlockLeaseRenew. Additionally,ValidateStagedBlock(line 2779) omitscase BlockLeaseRenew:, rejecting conflictinglease_renewblocks withstaged block: unknown type: lease_renew.
Finding 4: Multi-Asset (XE vs XUSD) Balance Corruption in GetBalance, GetAllAccounts, SpendableBalances, and Conflict Staging (core/ledger.go, core/spendable.go, node/node.go)
Root Cause
Ledger.GetBalance&Node.GetAllAccountsReturnXUSDBalance asXEBalance (core/ledger.go:2361-2372,node/node.go:998-1001): AnAccountChaininterleaves both"XE"and"XUSD"blocks whereb.Balancestores the post-block balance ofb.Asset. However,Ledger.GetBalance(account)returnschain.LatestBalance()(chain.Blocks[len-1].Balance) andNode.GetAllAccounts()setsBalance: chain[len(chain)-1].Balance. Whenever an account's latest block is an"XUSD"block (mint,lease,lease_accept,lease_renew,lease_cancel,lease_force_settle, orXUSDsend/receive), both methods return the account'sXUSDbalance as itsXEbalance.- Conflict Staging
parentBalanceOmitsBlockLeaseSettleStake Return & Default"XE"Asset (core/ledger.go:832-842): When staging a conflict block inaddBlock,parentBalanceis computed via an inline loop (if cb.Asset == b.Asset { parentBalance = cb.Balance }) instead ofl.GetAssetBalanceAtBlock(b.Account, b.Asset, b.Previous). This misses thelease.Stakecredited to"XUSD"byBlockLeaseSettleblocks (commit.AssetCredit), causingValidateStagedBlockto reject valid"XUSD"conflict blocks on provider chains after a lease settlement with a falsebalance mismatch. SpendableBalancesOmitsBlockLeaseSettleStake Credit (core/spendable.go:30-50): WhenBlockLeaseSettle(b.Asset == "XE") executes on a provider's chain,lease.Stakeis returned to the provider's"XUSD"balance. WhilerebuildAssetBalancesandGetAssetBalanceAtBlockcreditlease.Staketo"XUSD"onBlockLeaseSettle,SpendableBalances(core/spendable.go) ignores it, under-reporting the provider's finalized spendableXUSDbalance bylease.Stakeand miscomputing unfinalizedXUSDoutflows after an unfinalizedBlockLeaseSettle.
Thread
Independent reproduction of Finding 3 (XUSD supply conservation), with the exact identity
Not a new report — just confirming from the outside, with numbers, that this still reproduces on testnet-0005.
Measured on GET /supply (6 samples over ~30 s, identical every time):
| field | value |
|---|---|
XUSD.created |
213000000 |
XUSD.accounted |
212967682 |
XUSD.discrepancy |
−32318 |
XUSD.conserved |
false |
And the gap is exactly the renewal escrow that termsFromChain drops:
Σ renewals[].cost over all 101 leases (46 renewals) = 32318
XUSD.created − XUSD.accounted = 32318 ← exact match
Reproduce in three commands:
NODE=https://ldn.core.test.network
curl -s $NODE/supply | jq '(.assets.XUSD.created - .assets.XUSD.accounted)' # 32318
curl -s "$NODE/leases?limit=1000" | jq '[.[].renewals[]?.cost] | add' # 32318
curl -s $NODE/supply | jq '.assets.XUSD | {escrow_burned, conserved}' # 67738, false
Two data points that may help when fixing:
escrow_burnedcurrently equals the sum of settled leases' initial cost only (67738) — which confirms renewals are the only missing term. Cancelled leases are correctly excluded (they are refunded, not burned; their 1551 is absent fromescrow_burned).- The discrepancy drifts monotonically with renewals: a few hours earlier the same node reported
−27665withescrow_burned=58432. That makesconserveda usable post-fix regression check: after the fix it should flip totrueon the existing ledger (no wipe needed), and any future renewal must not move it.
Happy to leave this as evidence under this issue rather than filing a separate report.
Still reproduces at HEAD 89a542e (testnet-0005, 2026-11-10).
ValidateTunnelLease (node/node.go:2176-2190) still ignores peerID and performs no expiry check. A stranger libp2p peer that knows only the public lease hash reaches the VM SSH via SetupTunnelHandler (net/tunnel.go), and a lease expired ~47h ago is still accepted. Same ticket, same code: unauthenticated vm_status (node/vm.go:40-55) still returns full vm.Info including plaintext credentials to any peer.
Note the HTTP API path is fixed (XE-0026, X-Signature vs AccessPubKey) — the libp2p path has no auth at all.