{"id":"XE-0106","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"184","source_url":"https://github.com/xeprotocol/xe/issues/184","reporter_id":36,"title":"[Marketplace] Offer store admits any self-signed offer — 1000-offer flood silently drops legitimate offers, and last-wins overwrite diverts lease creation","area":"leasing-ledger","claimed_tier":"medium","assessed_tier":null,"verdict":null,"duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":null,"status":"triaging","closed_reason":null,"github_state":"open","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-10-29T13:57:27.846082+00:00","updated_at":"2026-11-10T00:11:56.953388+00:00","source_created_at":"2026-10-29T09:35:10+00:00","told_at":"2026-11-08T20:19:02+00:00","status_changed_at":"2026-11-08T20:17:53.044786+00:00","url":"https://bounty.xe.network/XE-0106","body":"Suggested severity: Medium (2,500 XE)\nArea: node / marketplace offer store (pendingOffers)\nRepo pin: 9787859 (testnet-0005)\n\n## Summary\n\nThe marketplace offer store (pendingOffers, admitted in node/node.go handleMarketplace, offer case) admits any validly self-signed offer with no binding to a request this node actually made, no per-sender quota, keying by RequestID only (not by provider), a silent 1000-entry cap, and last-wins overwrite. RequestLease returns whatever offer sits under a RequestID, and RequestAndCreateLease builds the lease block wholesale from the offer's fields with no check against the requested spec. Offer signature coverage itself is complete — the gap is store admission, not signatures.\n\nTwo effects share this deviation source:\n\n1. **Flood (the sharp claim):** an attacker fills the store with 1000 distinct validly self-signed offers, and the victim's legitimate live offer is silently dropped — lease acquisition fails for that request window.\n2. **Last-wins overwrite / diversion:** a second offer for one RequestID replaces the first, so the victim's auto-created lease is built from the attacker's offer instead of the provider's offer it had seen.\n\n## Mechanism\n\n- Store admission (node/node.go handleMarketplace, offer case, :1411-1423): keyed by RequestID ONLY, capped at 1000 with silent drop above the cap, pruned only at 60s staleness. No check that an offer answers a request this node made, no first-wins rule, no per-sender quota.\n- RequestLease (node/node.go:2042, 30s window) returns whatever offer sits under its RequestID.\n- RequestAndCreateLease (node/vm.go:169) builds the lease block wholesale from the offer's Provider/VCPUs/MemoryMB/DiskGB/TotalCost/CertificateHash with NO check against the requested spec.\n- What is NOT broken (checked and clean): offer signature coverage is complete — offerCanonical (net/marketplace_sign.go:64) covers every ResourceOffer field except Signature (Provider, ProviderPubKey, RequestID, VCPUs, MemoryMB, DiskGB, Duration, TotalCost, CertificateHash, Timestamp) under a domain tag + network ID, and VerifyPayloadKey (core/address.go:5) binds the pubkey to the claimed account. Tampered offers fail verification (proven as the PoC's negative control). Same for advertisements and requests. Reputation self-dealing is also not a finding: reputation derives only from ledger events and gates no privilege, payment, or eligibility in code.\n\n## Trigger\n\nNo privilege, no victim key, no funds. Signing with the attacker's own key is self-serve, and the gossip marketplaceValidator accepts any validly signed offer. The attacker needs only to be able to deliver offers to the victim node (gossip) — no interaction with the victim beyond that.\n\n## Proof of concept\n\nExercised through the REAL node.handleMarketplace handler in a scratch copy of the pinned tree (repo tree left clean); independently re-run and reproduced:\n\n- Positive control: a legitimate offer is stored in an empty store → OK.\n- Negative control: an offer whose cost is tampered post-signing → rejected → OK (signature coverage works).\n- Flood: 1000 distinct validly self-signed attacker offers fill the store, then the legitimate offer for the victim's live request is DROPPED (stored=1000, legitimate-present=false). Test: TestMarketplaceOfferFloodCap — PASS.\n- Last-wins: two valid offers for one RequestID — the second provider replaces the first. Test: TestMarketplaceOfferLastWins — PASS.\n\nReproduce: `go test ./node -run 'TestMarketplaceOfferFloodCap|TestMarketplaceOfferLastWins' -count=1 -v`\n\n## Impact\n\n- Lease-acquisition availability: a victim node cannot obtain a lease through the marketplace while the store is flooded for its request window. The flood must be sustained (60s prune means one wave blocks roughly one 30s request window per refresh) — it is not a single-shot permanent denial.\n- Diversion: the victim's auto-created lease can be built from an attacker's offer rather than the provider offer it had seen, with provider/specs/cost taken from the attacker's offer fields.\n- No direct fund theft is proven. The settle-without-service leg (#90, already reported) is NOT relied on.\n\n## Honest limits\n\n- Proven at node-handler level (real handleMarketplace), NOT across a live gossip network — delivery timing and gossipsub propagation are traced, not executed.\n- The diversion half leans on RequestAndCreateLease using offer fields unchecked (code trace) and is bounded by ledger caps, cost-equality checks, and the 0.5–10x certificate multiplier. The marketplace has no provider-selection feature, so triage may call any-offer-wins design (though not last-wins-overwrite).\n- The flood (lease-acquisition availability) half is the sharp claim.\n- No testnet transaction was made; no other user's funds, keys, or workloads were involved.\n\n## Duplicate check\n\nNo match. The repo's full marketplace-related issue/PR census is six items (#18 + its fix PRs #134/#22, #156, #10, #154); none covers offer-store admission. Distinguished from: #18 (marketplace freshness — message age, not store cap / overwrite; its fix PRs #134/#22 propose TTL eviction, which does not close a within-window flood of fresh offers or a last-wins overwrite — and request-binding/first-wins would not close #18's stale-message acceptance); #172 (API rate-limiter map cap — a different component and mechanism: IP-based API limiter vs RequestID-keyed offer map); #47/#41 (gossip per-peer rate limit — delivery throttling, not store admission); #50 (SSE overflow — different subsystem). Live search for RequestLease and pendingOffers/marketplace returned no matching issue.\n\n## Suggested fix\n\nBind admitted offers to requests this node actually made; key the store by (RequestID, provider) or enforce first-wins per RequestID; add a per-sender quota; make cap eviction visible/prioritised (e.g. never silently drop a live request's offer for unsolicited offers); and check the chosen offer against the requested spec in RequestAndCreateLease before building the lease block.\n\n## Reporter\n\nXE payout address: 24b1be6a99de922902aceccce2456abc3769e4ab1cac463ea86fb23496b868b3\nDiscovered: 2026-10-29, against the public testnet implementation at the pinned commit. Reproduction was local only; no other users' funds, keys or workloads were touched.","patch_refs":[{"id":181,"repo":"xeprotocol/xe","kind":"pr","ref":"186","title":"fix(node): bind marketplace offers to active requests, enforce first-wins and sender quota (fixes #184)","url":"https://github.com/xeprotocol/xe/pull/186","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-10-29T13:57:30.091343+00:00"}],"thread":[{"id":1168,"source":"github","source_ref":"6726598421","author":"Joseph Denne","team":true,"body":"Thanks for the detailed report. We have confirmed the behaviour and it is being handled; we will update this ticket when there is more to share.","created_at":"2026-11-08T20:19:02+00:00"},{"id":1540,"source":"github","source_ref":"6729887194","author":"memekomik","team":false,"body":"@josephdenne  Quick triage note regarding timestamp priority on the RequestAndCreateLease (node/vm.go:169-185) unchecked offer spec/cost validation: per the \"Critical? Email first\" policy, I privately reported this vulnerability and full Go PoC to security@xe.network on 2026-10-29 at 01:14:53 UTC (08:14:53 +0700, hours prior to this GitHub issue), and later cross-filed via the web portal on Nov 4 after receiving no email reply. Could you please check security@xe.network for Message-ID: <CAM7sBFZ1HgVGR8EvcFrqCQ=GP_TGgp4EcKeszp31A+_ux_Z0HA@mail.gmail.com> (Subject: [CRITICAL] Unvalidated Marketplace Offers Allow Arbitrary XUSD Escrow Drain & XE Minting (testnet-0005)) before finalizing duplicate/severity resolution?","created_at":"2026-11-09T01:13:09+00:00"},{"id":3113,"source":"github","source_ref":"6787319517","author":"zafrans","team":false,"body":"**Payout address update**\n\nHi team — a quick correction to the Reporter section of this report.\n\nThe XE payout address previously listed here (`24b1be6a99de922902aceccce2456abc3769e4ab1cac463ea86fb23496b868b3`) is no longer accessible to me — I no longer control the key for that wallet. Please disregard it.\n\nMy current XE payout address is:\n\n`5dc48847412ffe94e4f7097b81ee111b9e207b47c9c1f3bab988f08b63bcc7e3`\n\nPlease use this address for any award for this report. I am posting the same update on my other reports (#175, #183, #184, #191). Thank you.","created_at":"2026-11-11T04:48:46+00:00"}]}