Bounty
XE-0009 · Bounty

Marketplace messages carry no freshness check: signed advertisements, requests, and offers are accepted at any age, and stored provider advertisements never expire

Accepted claimed Medium xe#18 filed 2026-10-23 18:40 UTC by rusdiwireng

Report

Suggested severity tier: Medium

Area: marketplace gossip validation and handling, net/marketplace_sign.go, net/gossip_validate.go, node/node.go (handleMarketplace, providerAds, GetProviders), api/handler.go (GET /providers)

Repository state checked: xeprotocol/xe HEAD 978785929bc17a2f4ab30c383e5fc9cf4d634512

Summary

Marketplace messages are verified by signature only. The timestamp inside each signed advertisement, request, and offer is part of the signed payload, and no verification or handling code compares it with the current time. A signed message of any age passes the gossip validator and is handled as if it were fresh. Stored provider advertisements have no expiry and no eviction path, so a replayed advertisement can place a provider listing on a receiving node and keep it there indefinitely, and a replayed request makes the provider do the request work again and publish a new signed offer for every delivery.

This report was verified on two local nodes built from the public source at the HEAD above. A full verification record, a rerun script for the two node setup, and the run logs are available on request.

What was proven

Reference time for the run: 2026-10-23T18:01Z. Node B was a plain receiving node. A separate harness participant, built from the repository net package and using the production topic validators, published signed marketplace messages over the real gossip topic xe/marketplace. Node B had a single peer at a time and no other message source.

Step 1, a 90 day old advertisement is accepted and stored. The harness published a provider advertisement with Timestamp 1785002467224125602, 90 days old at the reference time, for provider account e0c9dc271e5497087abfad19eeaafe1a8b7bfd5c8e9b87e4553289326d53a0ce, advertising 64 vCPUs, 262144 MB memory, 4096 GB disk, and 99 maximum concurrent leases. Node B logged no rejection for it. The message passed the gossipsub marketplace validator, which calls the signature-only VerifyAdvertisement (net/gossip_validate.go:177), and handleMarketplace stored it at node/node.go:1399 with providerAds.Store and no timestamp comparison.

Step 2, the ghost provider is listed by the receiving node. Before any injection, GET /providers on node B returned an empty list, []. After step 1, the same endpoint returned the ghost account with the advertised capacity and the 90 day old timestamp served as-is. The listing comes from GetProviders (node/node.go:1071), exposed at GET /providers (api/handler.go:188), which the API docs describe as the way consumers pick a provider. The ghost provider is a keypair generated inside the harness. It never ran a node and never sent any other message.

Step 3, there is no monotonic guard and no expiry. A fresh advertisement for the same provider (timestamp 1792778505484263636, 111 vCPUs) was stored. An older advertisement (timestamp 1784138535085603554, 100 days old, 222 vCPUs) delivered after it was stored over the fresh one, and the listing moved backwards in time to 222 vCPUs with the 100 day old timestamp. The byte-identical step 1 message was then published again about 2.5 minutes later (harness logs at 18:01:07Z and 18:03:34Z) and was accepted and stored again, returning the listing to 64 vCPUs with timestamp 1785002467224125602. A search of node/ and api/ finds four references to providerAds (node/node.go:76, 1050, 1075, 1399) and no Delete call, no TTL, and no prune. GetProviders ranges over the map with no timestamp filter. By contrast, pendingOffers in the same node receives a 60 second freshness prune, so freshness handling exists in this codebase and advertisements are the case it misses.

Step 4, replayed requests multiply provider work and offers. Ten identical copies of one stale signed lease request were delivered to a provider node. The provider handler executed for the deliveries and published 10 fresh signed offers, one per copy. A control request with a tampered signature produced 0 offers, so the count follows from accepted replays of validly signed bytes. At Level A (two real node processes) the handler execution was shown for repeated deliveries of identical bytes up to the provider certificate gate. The exact count of 10 was measured at Level B with the real handler and real gossip, with an unexpired performance certificate injected into the provider node object. That injection is disclosed in the limits section below.

Step 5, future-dated advertisements are accepted. An advertisement signed with a timestamp 90 days in the future passed the same validator and was stored the same way. Timestamps far in the future are accepted just as timestamps far in the past are.

Reproduction

  1. Clone https://github.com/xeprotocol/xe and confirm HEAD is 978785929bc17a2f4ab30c383e5fc9cf4d634512.
  2. Build the node from source and start a plain receiving node on localhost with discovery disabled. Confirm GET /providers returns [].
  3. Using a libp2p participant with the production marketplace topic validator, publish a provider advertisement signed with a timestamp 90 days in the past. Observe that the receiving node stores it and that GET /providers then lists the provider with the old timestamp.
  4. Publish a fresh advertisement for the same provider, then an older one (100 days), then the step 3 message again byte for byte. Observe the listing following each delivery, including the move backwards in time.
  5. Deliver ten identical copies of one stale signed lease request to a provider node and count the signed offers it publishes. Repeat with a tampered signature as a control and observe zero offers.
  6. Publish an advertisement signed 90 days in the future and observe acceptance.

A ready rerun script for the two node setup, with the full logs, is available on request.

Impact

Any party holding one validly signed provider advertisement can keep that provider listed on every node that receives the replay, for as long as replays continue, with capacity figures the signer published once in the past. Consumers read GET /providers to choose a provider, so a stale or withdrawn provider can stay visible and keep attracting lease attempts, and an old advertisement with higher capacity can displace the current one. Replayed requests impose repeated work on providers and produce a fresh signed offer per copy, so a single captured request becomes a standing source of provider CPU and outbound offers. Because advertisements never expire, a node that has been running a long time accumulates listings with no relation to which providers are still present.

Suggested fix

Add a timestamp freshness window to the verification of all three marketplace message types, so messages older than the window, or dated beyond a small future allowance, fail VerifyAdvertisement, VerifyRequest, and VerifyOffer. Store an advertisement only when its timestamp is newer than the one already stored for that provider. Give providerAds a TTL with periodic eviction, in the same style as the existing pendingOffers prune. Deduplicate requests by message hash and timestamp at the handler, so repeated deliveries of the same signed request return the existing offer or are dropped instead of producing new work.

Honest limits of this proof

The two node proof ran on localhost and shows the behavior of each receiving node. It does not measure how far a replay spreads across the public mesh, and this report makes no claim about a public blast radius. The offer count in step 4 was measured at Level B with an unexpired performance certificate injected into the provider node object. An operating provider holds such a certificate in normal steady state, and the injected certificate sits outside the code path under test, but the substitution is stated here so the measurement can be weighed accurately. The local nodes ran the embedded genesis from the source tree. The public testnet-0005 network runs build xe/92d83d1, whose source is not the public HEAD used here, so the live network may differ in ways this report cannot see.

Thread

XE deskteam2026-11-10 00:15 UTCgithub

Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is updated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-0009.