Bounty
XE-13375 · Bounty

Provider advertisements are replayable and never expire: a stale or revoked ad is accepted as current

Closed · duplicate —claimed Minor xe#529 filed 2026-11-13 03:20 UTC by AIRDROP TREASURESS

Report

Suggested tier: Low

XE address (reward destination): 9b663fdac108be34a3b715ef78a9f9bd878af6ef8142f388c6514918e6852dd7

Summary

net/gossip_validate.go, marketplaceValidator, ad case (~l.41–44): the ONLY checks on an incoming provider advertisement are (a) ad.Signature valid over ad.PubKey, and (b) timestamp not in the future (ad.Timestamp > now+1m). There is NO freshness check on old timestamps, NO nonce, NO expiry (30 min TTL exists in the directory, but Advertisement in types/types.go has no TTL field and the advertisement TTL is never checked in net/gossip_validate.go).

So a captured signed ad can be replayed later — same signature, same timestamp, still valid — including after the provider rotated its price/capacity or removed the ad entirely. An old ad is accepted as current.

Impact

An old ad can lure a consumer into requesting a lease from a provider that no longer offers those terms (e.g. price or vCPU), causing the consumer to commit funds to a lease that won't match their expectation (though the lease's cost is re-verified by the ledger — validateAndAddLease recomputes LeaseCost from the pinned certificate, so the monetary damage is bounded; the consumer is also stuck waiting for the lease to settle or cancelling it).

Severity is Low because (a) the ad's content (price/dims) is pinned by the certificate, so a replayed ad cannot create a fraudulent lease with a different price, and (b) the consumer can cancel an unaccepted lease and get refunded.

Steps to reproduce

Unit test against the real node code (github.com/xeprotocol/xe, testnet-0005, commit 89a542e):

git clone https://github.com/xeprotocol/xe
cd xe
cp market-node_test.go node/
cp market-net_test.go net/
go test ./node -run TestMarket -v -count=1
go test ./net -run TestMarket -v -count=1

Note: market-node_test.go / market-net_test.go are NOT in the public repository — the PoC test files are attached to this issue; without them, the XE team cannot run this reproduction.

PoC 2a — stale ad accepted (TestMarketAdvertisement_StaleAndReplayAccepted, in market-node_test.go): feed an ad with Timestamp 1 hour in the past through the real handleMarketplace.

Expected: the stale ad is rejected. Actual (reproduced 2026-11-13): the ad is stored and served to RequestLease.

CONFIRMED: stale advertisement (1h old) accepted and stored

PoC 2b — replayed ad accepted (TestMarketAdvertisement_StaleAndReplayAccepted, second half): the same signed ad is replayed later — the signature is still valid, so it is accepted again (no nonce / dedup).

Expected: a replayed ad is rejected. Actual: accepted.

CONFIRMED: replayed advertisement accepted again (no nonce / dedup on ad)

Root cause

net/gossip_validate.go, marketplaceValidator, ad case: no lower-bound timestamp check, no nonce, no expiry; types/types.go, Advertisement has no TTL field; the 30 min directory TTL (net/directory.go, DirectoryEntry) is never consulted by the advertisement validator.

Suggested fix

Add a freshness window for ads (e.g. 60 s, matching the pendingOffers prune), a monotonically increasing nonce per provider, and an expiry field in Advertisement that is checked on ingest.

Controls verified (same PoC files, all PASS)

  • Cross-context signature reuse (ad ↔ request ↔ offer) is rejected — distinct domain tags (xe/marketplace-advertisement/v1, -request/v1, -offer/v1) plus different field sets (TestMarketCrossContext_SignatureReuseRejected).
  • TotalCost / Timestamp forgery is rejected — both fields are signature-covered; only exact replays pass (TestMarketTamper_TotalCostAndTimestampSigned). Even a tampered cost could not create a bad lease (ledger recomputes LeaseCost from the pinned cert).
  • Stale-price lease via a replayed offer is not reachable through the honest consumer flow: RequestLease generates a fresh RequestID per call and only accepts offers for it, and the ledger re-verifies cost against the pinned certificate.
  • Directory impersonation / registration replay is neutralised (monotonicity + 30 min TTL, TestMarketDir_MonotonicityRejectsOldReplay, market-dir_test.go).

market-node_test.txt market-net_test.txt market-dir_test.txt

Thread

Joseph Denneteam2026-11-20 00:51 UTCgithub

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