{"id":"XE-12970","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2305,"title":"SDK: `gatherAttestations` never checks set membership — an out-of-set key counts toward the threshold the node then rejects","area":"sdk-docs-web","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T14:51:12.127467+00:00","updated_at":"2026-11-20T19:45:53.502091+00:00","source_created_at":null,"told_at":"2026-11-20T19:45:53.526272+00:00","status_changed_at":"2026-11-20T19:45:53.510393+00:00","url":"https://bounty.xe.network/XE-12970","body":"## Summary\n\n`gatherAttestations` (`sdk/src/attestation.ts`) checks only\n`att.publicKey === tk.publicKey` (the attestation matches its own list slot)\nplus signature validity. It never checks `set.keys.includes(att.publicKey)`.\nA caller-assembled `Timekeeper[]` containing an entry whose key is not in the\ntrusted set yields a threshold-satisfying list the node rejects. The docstring\npromises three local checks — \"signature, key membership, one per key\" — and\nthis is the one remaining unenforced check (signature is enforced; one-per-key\nis XE-3100; the 20-cap is XE-3094; skew is XE-0254). The internal `Xe.#attest`\npath is shielded by `discoverTimekeepers` (which does check membership); the\nexposure is to direct callers of the exported function, the same framing\nXE-3100 establishes.\n\n## Reproduction (sdk @ 116f4b7, built dist/)\n\n- `attest-rerun.mjs`: mock timekeepers, `set={keys:[tk1,tk2,tk3],threshold:2}`,\n  list `[tk1, outsider]` → `RETURNED 2` attestations including the outsider\n  key. Bad-sig control correctly throws (`gathered 1 of 2`).\n- Differential driver: Go `ValidateAttestations` rejects the outsider+valid\n  set (\"only 1 valid attestations from trusted timekeepers, need 2\").\n- **Live proof** `attest-outsider-live.mjs`: renewal carrying one real + one\n  validly-signed outsider attestation → node 400\n  `lease_renew attestation: only 1 valid attestations from trusted\n  timekeepers, need 2`. (Companion: `attest-live-proof.mjs` proves the same\n  rejection for the duplicate-key variant, with a distinct-keys control\n  accepted.)\n\n## Impact\n\nLate failure after PoW: the caller is told a threshold of trusted timekeepers\nattested; the renewal/force-settle block is rejected as a whole. Bounded\n(node re-validates; no funds move). Minor, consistent with XE-3100/XE-3094/\nXE-0254. Triage may fold it into the `gatherAttestations` family, but\nXE-3100's own neighbour-note treats each unenforced check as a distinct\ndefect with a distinct fix (here: verify membership against `set.keys` before\ncounting) — disclosed for triage.\n\n## Duplicate check (neighbour bodies read in full)\n\n- XE-3100: dedup only; explicitly distinguishes itself from XE-3094 (cap) and\n  XE-0254 (skew); membership not claimed.\n- XE-3094: cap only. XE-0254: skew only — and it *assumes* membership is\n  checked (\"The SDK verifies the signature and the key membership\"), a premise\n  this report disproves.\n- Searches, all with no membership hit: `gatherAttestations` (12 hits, all\n  considered), `attestation membership` (0), `untrusted timekeeper` (0),\n  `outsider attestation` (0), `set.keys` (7, none relevant),\n  `trusted timekeeper` (8, none relevant), `timekeeper threshold` (8, none\n  relevant). Nothing title-only.\n\n## Suggested fix\n\nVerify `set.keys.includes(att.publicKey)` (membership in the trusted set)\nbefore counting an attestation toward the threshold, alongside the existing\nsignature check.","patch_refs":[],"thread":[{"id":15305,"source":"desk","source_ref":"reply:13196","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-12970 and says what differs; it is read like any other.","created_at":"2026-11-20T19:45:53.502091+00:00"}]}