SDK: `gatherAttestations` never checks set membership — an out-of-set key counts toward the threshold the node then rejects
Report
Summary
gatherAttestations (sdk/src/attestation.ts) checks only
att.publicKey === tk.publicKey (the attestation matches its own list slot)
plus signature validity. It never checks set.keys.includes(att.publicKey).
A caller-assembled Timekeeper[] containing an entry whose key is not in the
trusted set yields a threshold-satisfying list the node rejects. The docstring
promises three local checks — "signature, key membership, one per key" — and
this is the one remaining unenforced check (signature is enforced; one-per-key
is XE-3100; the 20-cap is XE-3094; skew is XE-0254). The internal Xe.#attest
path is shielded by discoverTimekeepers (which does check membership); the
exposure is to direct callers of the exported function, the same framing
XE-3100 establishes.
Reproduction (sdk @ 116f4b7, built dist/)
attest-rerun.mjs: mock timekeepers,set={keys:[tk1,tk2,tk3],threshold:2}, list[tk1, outsider]→RETURNED 2attestations including the outsider key. Bad-sig control correctly throws (gathered 1 of 2).- Differential driver: Go
ValidateAttestationsrejects the outsider+valid set ("only 1 valid attestations from trusted timekeepers, need 2"). - Live proof
attest-outsider-live.mjs: renewal carrying one real + one validly-signed outsider attestation → node 400lease_renew attestation: only 1 valid attestations from trusted timekeepers, need 2. (Companion:attest-live-proof.mjsproves the same rejection for the duplicate-key variant, with a distinct-keys control accepted.)
Impact
Late failure after PoW: the caller is told a threshold of trusted timekeepers
attested; the renewal/force-settle block is rejected as a whole. Bounded
(node re-validates; no funds move). Minor, consistent with XE-3100/XE-3094/
XE-0254. Triage may fold it into the gatherAttestations family, but
XE-3100's own neighbour-note treats each unenforced check as a distinct
defect with a distinct fix (here: verify membership against set.keys before
counting) — disclosed for triage.
Duplicate check (neighbour bodies read in full)
- XE-3100: dedup only; explicitly distinguishes itself from XE-3094 (cap) and XE-0254 (skew); membership not claimed.
- XE-3094: cap only. XE-0254: skew only — and it assumes membership is checked ("The SDK verifies the signature and the key membership"), a premise this report disproves.
- Searches, all with no membership hit:
gatherAttestations(12 hits, all considered),attestation membership(0),untrusted timekeeper(0),outsider attestation(0),set.keys(7, none relevant),trusted timekeeper(8, none relevant),timekeeper threshold(8, none relevant). Nothing title-only.
Suggested fix
Verify set.keys.includes(att.publicKey) (membership in the trusted set)
before counting an attestation toward the threshold, alongside the existing
signature check.
Thread
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-12970 and says what differs; it is read like any other.