{"id":"XE-13263","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"387","source_url":"https://github.com/xeprotocol/xe/issues/387","reporter_id":1787,"title":"node/certs: no global retention cap — free self-signed identities defeat the per-provider limit (store and boot-RAM exhaustion)","area":"p2p-sync","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:05.537511+00:00","updated_at":"2026-11-20T00:07:01.378787+00:00","source_created_at":"2026-11-11T12:57:05+00:00","told_at":"2026-11-20T00:04:57+00:00","status_changed_at":"2026-11-20T00:04:35.691826+00:00","url":"https://bounty.xe.network/XE-13263","body":"## Summary\n\nPerformance certificates are self-signed and `Provider` is derived from the signer key, so an attacker can mint a fresh free identity per certificate. Retention is capped only per provider (256) and there is no global ceiling: the `certSet.len()` helper has no callers. Every accepted certificate is persisted and re-loaded into RAM at boot, and certificate ingestion is registered outside the `isProvider` gate, so validators and observers accumulate them too.\n\n## Affected code\n\n| Location | Fact |\n|---|---|\n| `perf/certificate.go:156-197` | `VerifyCertificateContent`: hash, signature, `Provider`↔`ProviderPubKey`, `Score > 0`, workload version, `Puzzles`, 64-hex `CPUHash`, multiplier ∈ [500,10000]. No length bound on `Seed`/`WorkProof`/merkle roots, no expiry check |\n| `net/gossip_validate.go:160-176` | topic validator calls `VerifyCertificateContent` only |\n| `net/gossip.go:25,27,42` | topic `xe/certificates`, `MaxGossipMessageSize = 262144` |\n| `node/certset.go:10,36-54` | `certRetentionPerProvider = 256`, applied per `cert.Provider` |\n| `node/certset.go:102-106` | `len()` defined, never called |\n| `node/perf.go:329-337` | `handleCertificateGossip` → `ingestCertificate` |\n| `node/perf.go:358-377` | `retainCertificate` persists every accepted cert; `DeleteCertificate` only for per-provider evictions |\n| `node/perf.go:379-404` | `loadPersistedCertificates` loads all persisted certs into RAM at boot |\n| `node/node.go:515-567` vs `578-581` | `if n.isProvider { … }` ends at 567; `handleCertificateGossip`, `loadPersistedCertificates()` and `SetupCertSync` are outside it |\n| `net/certsync.go:23,27-33,41-60` | pull capped at 256 certs / 64 KiB per response, on connect and every 2 minutes |\n\n## Reproduction\n\n1. Generate a new ed25519 key per certificate so `Provider` differs each time.\n2. Sign the certificate with that key; `VerifyCertificateContent` accepts it. No length bound rejects a large `Seed`/`WorkProof`.\n3. Publish it on `xe/certificates` (256 KiB message ceiling; there is no per-peer limiter on this topic — the message limiter covers `/xe/msg`, cf. #41/#47).\n4. Observe `byHash`/`byProvider` growth with zero evictions: each certificate belongs to its own provider, so the `len(list) >= 256` test never becomes true.\n5. Restart the node: `loadPersistedCertificates` allocates the entire accumulated set.\n\n## Impact\n\nRemote, unauthenticated, zero-cost, persistent across restarts. Badger storage and boot-time RAM grow without bound on every node that subscribes to certificates, including non-provider nodes. At sufficient volume the node OOMs at startup and stays down until the store is cleaned manually.\n\n## Suggested fix\n\nAdd a global cap with TTL/LRU eviction across providers; rate-limit certificate ingest per peer on the topic; bound `Seed`/`WorkProof`/merkle-root lengths in `VerifyCertificateContent`; gate certificate ingest to explicit provider/observer roles instead of every node.\n\n## Notes\n\n- **Duplicate check:** checked issues — no duplicate as of 2026-11-11 (closest: #366 cert-sync truncation, #259/#260 expired-certificate propagation, #354 emission multiplier, #6 forged score/expiry, #97/#120 stale certificate on renew; none concerns unbounded retention or the absent global cap).\n- **Evidence status:** code-level only (line references above); no runtime OOM was produced on the live testnet.\n- **XE Address for Reward:** `b83e7e31358b8c1e1509de6cd34e7540425eb17a190e48b486909df11080033d`\n\n\n\n> Reward address updated to the official desk-bound address.\n","patch_refs":[{"id":735,"repo":"xeprotocol/xe","kind":"pr","ref":"884","title":"fix(xe): node-certs--no-global-retentio (fixes #387)","url":"https://github.com/xeprotocol/xe/pull/884","note":"","state":"open","author":"tipprb","added_by":"desk","created_at":"2026-11-19T19:36:55.083591+00:00"},{"id":736,"repo":"xeprotocol/xe","kind":"pr","ref":"885","title":"fix(xe): node-certs--no-global-retentio (fixes #387)","url":"https://github.com/xeprotocol/xe/pull/885","note":"","state":"open","author":"tipprb","added_by":"desk","created_at":"2026-11-19T19:36:55.096878+00:00"}],"thread":[{"id":12752,"source":"github","source_ref":"7025800135","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-13263 and says what differs; it is read like any other.","created_at":"2026-11-20T00:04:57+00:00"}]}