{"id":"XE-13380","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"392","source_url":"https://github.com/xeprotocol/xe/issues/392","reporter_id":2252,"title":"Performance certificates accepted without verifying proof-of-work or attestation roots","area":"leasing-ledger","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":"XE-0001","tracked":true,"internal_ref":"#1062","internal_url":"https://github.com/xeprotocol/core/issues/1062","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:13.619909+00:00","updated_at":"2026-11-25T17:15:51.184343+00:00","source_created_at":"2026-11-11T15:09:08+00:00","told_at":"2026-11-20T00:04:49+00:00","status_changed_at":"2026-11-20T00:04:24.848722+00:00","url":"https://bounty.xe.network/XE-13380","body":"**Title:** Performance certificates accepted without verifying proof-of-work or attestation roots\n\n**Suggested tier:** Low (borderline Informational — team to decide)\n\n**XE address (reward destination):** 9b663fdac108be34a3b715ef78a9f9bd878af6ef8142f388c6514918e6852dd7\n\n## Summary\n\n`perf.VerifyCertificateContent` checks only the certificate hash, the provider\nsignature, score > 0, workload version, puzzle count, CPUHash format, and the\nmultiplier range [500, 10000]. It never calls the existing `perf.VerifyWork`,\nand never checks `StartAttestationRoot` / `EndAttestationRoot` against real\ntimekeeper attestations. `node/perf.go`, `ingestCertificate`, applies no other\ncheck to gossiped certificates. The certificate does not even carry the nonces\nneeded to re-verify the CPU chain — only the issuing node holds them (exposed\nvia `GET /certificate/nonces/{hash}`).\n\n## Impact\n\nA provider can self-issue a certificate claiming any score, CPU hash,\nattestation roots, and any multiplier within [500, 10000], and every node will\nretain it and use it for lease pricing / provider display.\n\nImpact is bounded: the multiplier is legitimately provider-controlled within\nthe range, and the score is not used for ranking in the node code\n(logging/display only). Live certificates on the testnet confirm the fields in\nuse (e.g. provider 26740934… score 0.0337, multiplier 1000; f90fa879… score\n0.0425, multiplier 2500).\n\n## How this was verified\n\nCode inspection (no executable PoC — this is a verification gap proven by\nreading the code; any node can verify it by inspection):\n\n- `perf/certificate.go`, `VerifyCertificateContent` — checks only hash,\n  provider signature, score > 0, workload version, puzzle count, CPUHash\n  format, multiplier range. Never calls `perf.VerifyWork`, never checks\n  attestation roots.\n- `node/perf.go`, `ingestCertificate` — the only check applied to gossiped\n  certificates is `VerifyCertificateContent`.\n- `perf/benchmark.go`, `VerifyWork(seed, nonces, puzzles)` exists but is never\n  called on received certificates; the certificate carries no nonces for\n  re-verification.\n\n## Suggested fix\n\nVerify `VerifyWork` at ingest (fetch the nonces from the issuing node, or embed\nthe witness in the certificate), and/or verify the attestation roots against\nthe stored timekeeper attestations.","patch_refs":[],"thread":[{"id":3144,"source":"github","source_ref":"6843000639","author":"Cixuci","team":false,"body":"Update: I now have an executable PoC for this — a forged certificate is not just accepted by the verifier, it is ingested, retained, and served as the provider's current certificate, and gossiped network-wide.\n\n**Verification layer (`perf`).** A self-issued cert with **Score = 1e9, invented CPUHash (`dedede…`), garbage WorkProof (`0000…`), free-form attestation roots, Seed = `\"forged-seed-not-a-real-benchmark-seed\"`, multiplier 10000** passes `VerifyCertificateContent` — the only check that matters. A second forgery with score 0.0001 passes identically: the verifier is indifferent to every performance claim. Tamper control: a cert built from **real** full-target benchmark work (8 puzzles, `VerifyWork` confirms the genuine CPU hash/final hash), then altered to a wrong CPUHash, wrong WorkProof, **1000x inflated score**, and `Puzzles=1024` over 8-puzzle work, is **still accepted**. `VerifyWork(seed, nil nonces, 1024)` fails as expected — the witness is absent by design. **Expired certs also pass the content check** — `VerifyCertificate` (which enforces expiry) rejects them, but `VerifyCertificateContent` does not, and ingest uses only the latter. Price impact of the multiplier (the only cert field that reaches money): `LeaseCost(1vCPU,1GB,1GB,60s)` = 259 @ mult 500, 517 @ 1000, **5170 @ 10000**.\n\n**Ingest layer (`node`).** `(&Node{}).ingestCertificate(forged)` returns true; the cert is retained and served as the provider's **current** certificate (`GetCertificateByProvider`) and via the ledger lookup path (`certificateInfoByHash` exposes multiplier 10000). **Gossip propagation:** `net/gossip_validate.go` `certificateValidator` also calls only `VerifyCertificateContent`, so a forged cert passes topic validation and is relayed network-wide, not just accepted locally. An **expired forgery is also retained by hash** (ingest applies no expiry check; only the display path `currentValid()` filters it). Ledger-side expiry checks (`validateAndAddLease` / renew / accept compare block/attestation time vs `ExpiresAt`) still gate actual lease use, so expired retention alone is hygiene. **`VerifyCertificate` (with expiry) is never called** anywhere in non-test code — only `VerifyCertificateContent` is used (ingest + gossip validator). `loadPersistedCertificates` loads persisted certs with **no verification at all** (local-disk trust only; not a finding).\n\n**Nonces cannot be fetched to forge a passing `VerifyWork`.** `node.CertificateNonces` returns nonces only for the node's **own** local cert (`api/vm.go` `GET /certificate/nonces/{hash}`); for a gossiped cert it returns nil (proven in the ingest PoC). Negative control: genuine nonces for provider A **fail** `VerifyWork` under provider B's seed — the seed is bound to `DeriveSeed(startMedian, providerPubkey)`, so cross-provider nonce replay is impossible by construction. The flaw is that **nobody runs `VerifyWork` at all**, not that `VerifyWork` is bypassable.\n\n**Impact, honestly bounded (same as #392):** a provider can self-issue a certificate claiming any score/CPU hash/attestation roots/multiplier in range, and every node retains, relays, and displays it. Score deception can steer consumers toward a slow/expensive provider; the multiplier is provider-chosen by design, so the monetary effect is bounded by the legitimate range and by the consumer pinning a cert they (in principle) inspected. Score is used nowhere for ranking or pricing — only rendered on the provider page and logged.\n\n**Suggested fix:** verify `VerifyWork` at ingest (fetch nonces from the issuing node, or embed the witness in the certificate), verify attestation roots against stored timekeeper attestations, and call `VerifyCertificate` (expiry) — not just `VerifyCertificateContent` — in `ingestCertificate`, the gossip validator, and `loadPersistedCertificates`. Bound `Score` and cross-check it against `(EndMedian-StartMedian)`.\n\n**PoCs:**\n\n- `perf-cert-forgery_test.go` — 3 tests, PASS 3/3 (2026-11-13):\n  ```\n  go test ./perf -run 'TestForgedCertificateAccepted|TestWorkProofAndScoreAreNeverChecked|TestExpiredCertificatePassesContentCheck' -v -count=1\n  ```\n  (The real-work test takes ~42 s — full-target 8-puzzle benchmark on this VM.)\n- `perf-cert-ingest_test.go` — 1 test, PASS (2026-11-13):\n  ```\n  go test -vet=off ./node -run TestForgedCertificateIngested -v -count=1\n  ```\n\nPoC files: `perf-cert-forgery_test.go`, `perf-cert-ingest_test.go` — available on request (the .go files cannot be uploaded to GitHub as attachments; I can paste their contents here if the team wants them). Repo: `github.com/xeprotocol/xe`, testnet-0005, commit `89a542e`.\n\n**XE address (reward destination):** 9b663fdac108be34a3b715ef78a9f9bd878af6ef8142f388c6514918e6852dd7","created_at":"2026-11-13T03:34:14+00:00"},{"id":12582,"source":"github","source_ref":"7025797784","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as https://bounty.xe.network/XE-0001, 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-13380 and says what differs; it is read like any other.","created_at":"2026-11-20T00:04:49+00:00"}]}