{"id":"XE-13266","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"403","source_url":"https://github.com/xeprotocol/xe/issues/403","reporter_id":2481,"title":"[Re-report] XE-0116 still unfixed at HEAD 89a542e: POST /attestation/request signs forged zero-mid identifiers","area":"node-api","claimed_tier":"high","assessed_tier":null,"verdict":"notice","duplicate_of":null,"tracked":true,"internal_ref":"#1068","internal_url":"https://github.com/xeprotocol/core/issues/1068","status":"closed","closed_reason":"invalid","github_state":"closed","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T20:42:05.634822+00:00","updated_at":"2026-11-20T00:25:43.935502+00:00","source_created_at":"2026-11-11T18:57:26+00:00","told_at":"2026-11-20T00:24:42+00:00","status_changed_at":"2026-11-20T00:08:43.683540+00:00","url":"https://bounty.xe.network/XE-13266","body":"# [Re-report] XE-0116 still unfixed at HEAD 89a542e: POST /attestation/request signs forged zero-mid identifiers\n\n**Original ticket:** [XE-0116](https://bounty.xe.network/XE-0116) — \"`POST /attestation/request` signs any identifier whose hex[0:32] and hex[48:] match a registered account and whose middle 16 are zero; no caller proof; limiter keyed on identifier\"\n**Original status:** awarded, verdict valid, assessed High, award 3,500 XE, disclosed 2026-11-08 (GitHub issue xeprotocol/xe#308, internal ref xeprotocol/core#1068)\n**This report:** re-report — the defect is still present in the public repo snapshot. It is NOT a new bug. Filed in the style of XE-0608 (patched-but-still-broken).\n\n## Claimed fix and why it did not land\n\nPatch refs on the ticket:\n- xeprotocol/xe PR #342 (\"fix(node,api): require caller ownership for provider attestations and key limiter on source (Fixes #308)\"). Verified 2026-11-11: **still OPEN, never merged** (`gh pr view 342`, state OPEN, mergedAt null).\n- xeprotocol/core PR #1105 (\"fix: the attestation route no longer signs other accounts identifiers\"). State **not verifiable from public**: the repo `xeprotocol/core` does not resolve via the public GitHub API from this environment, and the board records no state for it. Either way, no fix is present in the public `xe` snapshot below.\n\n## Still broken at HEAD 89a542e (\"release: testnet-0005 quorum withhold fix\")\n\n`node/attestation.go:40-52` (`canAttest`) still contains the zero-mid bypass verbatim:\n\n```go\nconst zeroMid = \"0000000000000000\"\nif identifier[32:48] == zeroMid {\n    for _, reg := range n.Directory.List() {\n        a := reg.Account\n        if len(a) == 64 && a[:32] == identifier[:32] && a[48:] == identifier[48:] {\n            return nil\n        }\n    }\n}\n```\n\nAny 64-hex identifier whose first 32 and last 16 hex chars match a registered provider account, with 16 zero chars in the middle, is accepted — no caller-ownership proof anywhere on the path:\n\n- `node/node.go:2218` (`RequestAttestation`): checks only identifier length (64), the per-source rate limit, and `canAttest`, then `core.SignAttestation(identifier, ts, ...)`.\n- `api/handler.go:916-933`: HTTP `POST /attestation/request` calls it with no authentication.\n- `node/attestation.go:71` (P2P handler): `from` is only a libp2p peer ID, not account ownership.\n\n## Reproduction (local, throwaway test — created, run, deleted; repo clean)\n\n```go\nkp, _ := core.GenerateKeyPair()\ndir := directory.New(0)\nreg := directory.NewRegistration(\"12D3KooWTestPeerRepro0116\", time.Now().UnixNano(), kp)\ndir.Register(reg) // valid provider registration, signature via SignRegistration\nn := &Node{Directory: dir}\nacct := kp.Address() // 64 hex chars\nforged := acct[:32] + \"0000000000000000\" + acct[48:]\nn.canAttest(forged) // -> nil (accepted)\n```\n\nOutput, 2026-11-11:\n\n```\nBUG REPRODUCED (XE-0116): canAttest accepted forged zero-mid identifier\nbb0c89d79ccc4dcdb3db00edcd26be05 0000000000000000 653f47786f173174\n```\n\nSanity check in the same test: `canAttest` on the real registered account is also accepted, as expected. No live POST was sent (signing oracle probe is out of scope for read-only verification).\n\n## Impact — stated honestly\n\nThis is a timestamp-signing oracle for synthetic identifiers: anyone can obtain the node's signature over an identifier that is not a real lease or account. Direct use for lease settlement still needs an attestation over a real lease hash, so this is not a direct settle bypass — but the exact pattern the ticket reported is intact on the exact path, with the fix PR unmerged. Suggested severity: **High**, as originally assessed (3,500 XE award).\n\n## Duplicate check performed 2026-11-11\n\nBoard API `/v1/tickets?q=attestation&status=open&limit=200` — 73 tickets scanned. Related but different aspects only: XE-0030 (rate-limit check-then-act), XE-3024 (unbounded rate-limit map). No re-report of the zero-mid / caller-proof gap. Residual risk, stated honestly: tickets beyond the board's search index cannot be fully excluded.\n\n## Environment\n\n- Repo: `github.com/xeprotocol/xe`, HEAD `89a542e`, Go 1.25\n- No live requests were sent for this finding; verification is code + local test only.\n","patch_refs":[],"thread":[{"id":13030,"source":"github","source_ref":"7026260095","author":"XE desk","team":true,"body":"Thanks for the report. We read it against the code and could not confirm a bug in what it describes.\n\nThis report is closed as invalid. If we have missed something, file a new report that links\nhttps://bounty.xe.network/XE-13266 and says what; it is read like any other.","created_at":"2026-11-20T00:24:42+00:00"}]}