<!-- XE-13263 · node/certs: no global retention cap — free self-signed identities defeat the per-provider limit (store and boot-RAM exhaustion) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-13263>. The page is the record; this is the same page for reading.*

XE-13263 · Bounty

# node/certs: no global retention cap — free self-signed identities defeat the per-provider limit (store and boot-RAM exhaustion)

Closed · duplicate
—
[xe#387](https://github.com/xeprotocol/xe/issues/387)
filed 2026-11-11 12:57 UTC
by jalesfeva

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   P2P / sync

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-20 00:07 UTC

Told
:   2026-11-20 00:04 UTC

### Patches

- [xe#884](https://github.com/xeprotocol/xe/pull/884) open by tipprb
  fix(xe): node-certs--no-global-retentio (fixes #387)
- [xe#885](https://github.com/xeprotocol/xe/pull/885) open by tipprb
  fix(xe): node-certs--no-global-retentio (fixes #387)

### History

- [543819](https://bounty.xe.network/log/543819) 2026-11-20 00:06 UTC github.state\_pushed
- [543818](https://bounty.xe.network/log/543818) 2026-11-20 00:06 UTC github.labels
- [543755](https://bounty.xe.network/log/543755) 2026-11-20 00:04 UTC reply.mirrored
- [543335](https://bounty.xe.network/log/543335) 2026-11-20 00:04 UTC proposal.adopted
- [543334](https://bounty.xe.network/log/543334) 2026-11-20 00:04 UTC reply.sent
- [543333](https://bounty.xe.network/log/543333) 2026-11-20 00:04 UTC ticket.status new → closed
- [541708](https://bounty.xe.network/log/541708) 2026-11-20 00:04 UTC proposal.adopted
- [541707](https://bounty.xe.network/log/541707) 2026-11-20 00:04 UTC ticket.facts area
- [541706](https://bounty.xe.network/log/541706) 2026-11-20 00:04 UTC proposal.adopted
- [541705](https://bounty.xe.network/log/541705) 2026-11-20 00:04 UTC ticket.facts
- [541704](https://bounty.xe.network/log/541704) 2026-11-20 00:04 UTC proposal.adopted
- [541703](https://bounty.xe.network/log/541703) 2026-11-20 00:04 UTC ticket.facts

[Full history](https://bounty.xe.network/log?ref=XE-13263) · [JSON](https://bounty.xe.network/v1/tickets/XE-13263) · [markdown](https://bounty.xe.network/XE-13263.md)

### Report

## Summary

Performance 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.

## Affected code

| Location | Fact |
| --- | --- |
| `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 |
| `net/gossip_validate.go:160-176` | topic validator calls `VerifyCertificateContent` only |
| `net/gossip.go:25,27,42` | topic `xe/certificates`, `MaxGossipMessageSize = 262144` |
| `node/certset.go:10,36-54` | `certRetentionPerProvider = 256`, applied per `cert.Provider` |
| `node/certset.go:102-106` | `len()` defined, never called |
| `node/perf.go:329-337` | `handleCertificateGossip` → `ingestCertificate` |
| `node/perf.go:358-377` | `retainCertificate` persists every accepted cert; `DeleteCertificate` only for per-provider evictions |
| `node/perf.go:379-404` | `loadPersistedCertificates` loads all persisted certs into RAM at boot |
| `node/node.go:515-567` vs `578-581` | `if n.isProvider { … }` ends at 567; `handleCertificateGossip`, `loadPersistedCertificates()` and `SetupCertSync` are outside it |
| `net/certsync.go:23,27-33,41-60` | pull capped at 256 certs / 64 KiB per response, on connect and every 2 minutes |

## Reproduction

1. Generate a new ed25519 key per certificate so `Provider` differs each time.
2. Sign the certificate with that key; `VerifyCertificateContent` accepts it. No length bound rejects a large `Seed`/`WorkProof`.
3. 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).
4. Observe `byHash`/`byProvider` growth with zero evictions: each certificate belongs to its own provider, so the `len(list) >= 256` test never becomes true.
5. Restart the node: `loadPersistedCertificates` allocates the entire accumulated set.

## Impact

Remote, 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.

## Suggested fix

Add 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.

## Notes

- **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).
- **Evidence status:** code-level only (line references above); no runtime OOM was produced on the live testnet.
- **XE Address for Reward:** `b83e7e31358b8c1e1509de6cd34e7540425eb17a190e48b486909df11080033d`

> Reward address updated to the official desk-bound address.

### Thread

**Joseph Denne**team2026-11-20 00:04 UTCgithub

Thanks. This is the same finding as an earlier report that is not public, 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-13263 and says what differs; it is read like any other.
