Marketplace requests have no deduplication or rate limit: each valid request forces every provider to sign and publish an offer
Report
Suggested severity tier: Low
Area: marketplace request handling, node/node.go (handleMarketplace), net/gossip.go, net/marketplace_sign.go
Repository state checked: xeprotocol/xe HEAD 978785929bc17a2f4ab30c383e5fc9cf4d634512
Summary
The marketplace request handler has no deduplication, no per-consumer cache, and no rate limit. Every request that passes signature verification makes the provider check capacity, compute a price, sign an offer, and publish it to the whole mesh, and every node on the mesh verifies each published offer. There is no proof of work on marketplace messages. An attacker can re-sign the same request with a fresh timestamp, which produces new signed bytes and a new gossipsub message ID, so gossipsub deduplication never sees it as a repeat. One attacker message therefore turns into provider CPU and bandwidth work across the mesh, with no cost to the attacker beyond one signature per request.
What was proven
handleMarketplace case "request" (node/node.go:1311-1390) has no RequestID dedup, no request cache, and no per-consumer rate limit. A request that passes VerifyRequest goes through capacity checks, LeaseCost, SignOffer, and Publish. The gossip options (net/gossip.go:40-60) set no per-peer rate limit for gossip messages, and peer scoring rewards valid first deliveries. The request canonical form (net/marketplace_sign.go:44-56) includes Timestamp in the signed fields, so re-signing with a new timestamp creates a new message that gossipsub treats as new.
Proven with a local test against the real code: the same RequestID passed VerifyRequest under three different signatures (new timestamp plus changed resource fields). A code search found no seenRequests, requestCache, or any deduplication for requests in node/ or net/. What was not executed is the final step of the chain, a provider actually publishing offers in response to a flood, which needs a two-node harness.
Reproduction
- Clone https://github.com/xeprotocol/xe and confirm HEAD is 978785929bc17a2f4ab30c383e5fc9cf4d634512.
- Generate a keypair and sign a valid marketplace request.
- Re-sign the same RequestID with a fresh timestamp and deliver it again. Observe that VerifyRequest accepts it as a new message.
- Repeat and observe that nothing in the handler deduplicates or rate-limits the repeated requests.
Impact
Each request costs the attacker microseconds of signing and costs every provider a verification, a price computation, a signature, and a mesh-wide publish, plus a verification of each offer on every mesh node. The effect is CPU and bandwidth load only. It stops when the flood stops, and it leaves no permanent state except pending offers being pushed out, which is a separate issue. No funds move: an offer only becomes a lease when the consumer chooses it, and the consumer here is the attacker.
Suggested fix
Deduplicate requests by RequestID at the handler with a short-lived cache, add a per-consumer rate limit on requests, and consider a small proof of work for marketplace requests in the same style as chat envelopes.
Honest limits of this proof
The premises were proven locally: the same RequestID is accepted under multiple signatures, and no deduplication or rate limit exists in the code. The end-to-end amplification (counting offers a provider publishes per hundred requests) was not executed and needs a two-node harness. This report makes no claim about the public testnet.
Thread
Thanks for the fix in PR #286 — I reviewed it locally against the PR code, and the RequestID dedup closes the re-sign vector this issue reported (a duplicate RequestID is rejected, and the 11th request from the same consumer within a minute is rejected). One leg is still open:
The per-consumer rate limit (10 requests per minute) can be rotated away by changing identity. The consumer is self-asserted, and VerifyRequest only checks that the signature matches the claimed key, while a fresh ed25519 keypair is free to generate. Verified with a local probe: 20 fresh identities, each sending one request with a fresh RequestID and a valid signature, all passed within the same minute. So the flood in this report still works, it just has to change identity every 10 requests.
Thanks for the report. We have confirmed the behaviour you describe in the marketplace request handling and it is being handled. We will update this ticket when a fix has shipped.