{"id":"XE-13367","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"510","source_url":"https://github.com/xeprotocol/xe/issues/510","reporter_id":1981,"title":"Laporan bug","area":"p2p-sync","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","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:12.220416+00:00","updated_at":"2026-11-20T00:38:14.778495+00:00","source_created_at":"2026-11-12T16:21:34+00:00","told_at":"2026-11-20T00:34:48+00:00","status_changed_at":"2026-11-20T00:33:18.582286+00:00","url":"https://bounty.xe.network/XE-13367","body":"# XE Bounty — Laporan siap file (temuan pass 5 #3, subagent C)\n\nFile issue baru di: https://github.com/xeprotocol/xe/issues/new\nPaste judul + isi di bawah. Akun GitHub: Gib230223.\n\n---\n\n## Judul\n\n[Low] DAO readiness gate trusts self-asserted peer features — a representative can push a nonexistent feature to 1000/1000 ready\n\n## Isi\n\n## Summary\n\n`GET /network/readiness` is documented as \"the gate the DAO reads before signing an activation\". It reports delegated vote weight per *peer-advertised* feature string — but the feature list a peer advertises in the netcheck handshake is self-asserted and never validated against `core.KnownFeatures()`, and never truncated. A representative holding delegated weight can advertise a pending activation feature it does not implement and push that feature to 1000/1000 ready, while no node on the network implements it.\n\n## Evidence\n\n```go\n// net/netcheck.go:415,471 — both handshake directions store msg.Features verbatim:\ngater.RecordPeerCapabilities(pid, PeerCapabilities{Version: msg.Version, Features: msg.Features})\n\n// net/netcheck.go:354 checkPeer — validates network_id, genesis, version; never looks at Features.\nfunc checkPeer(msg netcheckMsg, ours netcheckMsg) (reason string, banDuration time.Duration) {\n    // ... network_id / genesis / version checks only ...\n    return \"\", 0\n}\n\n// net/features.go:68-72 — maxAdvertisedFeatures=8 caps only the LOCAL list:\nvar LocalFeatures = sync.OnceValue(func() []string {\n    f := core.KnownFeatures()\n    if len(f) > maxAdvertisedFeatures { f = f[:maxAdvertisedFeatures] }\n    return f\n})\n\n// node/activations.go:185 — GetReadiness sums delegated weight per advertised string, no validation:\nfor _, f := range c.Features {\n    info.FeatureWeight[f] += w\n}\n// ... then FeatureReadyMilli[f] = w * 1000 / info.TotalWeight\n```\n\n```go\n// api/handler.go:151 — the endpoint's documented purpose:\n{\"GET\", \"/network/readiness\", \"Delegated vote weight by advertised version and feature — the gate the DAO reads before signing an activation\", h.handleGetReadiness},\n```\n\nNote the local node's own entry is built from `core.KnownFeatures()` (`node/activations.go:165-168`) — only *remote* peers can inject invented names, which is exactly the trust boundary that is unchecked.\n\n## Impact (Low)\n\nA representative that already holds delegated weight can make the DAO activation gate read \"ready\" for a feature nobody implements — e.g. advertising a pending activation feature before any node ships it, so an activation is signed on false readiness. Severity is Low, not higher: the attacker must already be a registered representative holding delegated weight (it cannot be done by an arbitrary peer with no stake), and the consequence is a wrong gate signal, not a direct fund movement. The fix is one validation: intersect advertised features with `core.KnownFeatures()` (and cap the list length) at `RecordPeerCapabilities` or in `GetReadiness`.\n\n## Reproduction (PoC)\n\nUnit test, `node/poc5_readiness_test.go`, `TestPoc5ReadinessFakeFeature`, `go test ./node/ -run TestPoc5ReadinessFakeFeature -v -count=5`. It funds an account delegating ~1e16 uXE to a fresh representative, registers it in the directory, records caps with `Features: [\"fake-feature-xyz\", \"noop\"]`, and asserts that feature's readiness milli is ≥900.\n\nCoordinator run (2026-11-12 ~23:15 WIB), 5/5 PASS (one-line compile fix applied to the PoC as written — `GenerateEd25519Key` returns priv, pub, err):\n\n```\nsetup: rep 4be745caebb6 holds 10000000000000000 uXE of delegated weight\nBUG: nonexistent feature 'fake-feature-xyz' reports weight=10000000000000000, ready=995/1000 (total weight=10042000000000000)\n--- PASS: TestPoc5ReadinessFakeFeature (0.00s)\n```\n\n## Suggested fix\n\nValidate advertised features at ingestion: in `RecordPeerCapabilities` (or `checkPeer`), drop any feature not in `core.KnownFeatures()` and cap the list at `maxAdvertisedFeatures`. Alternatively, filter to known features in `GetReadiness` before summing weights. Either way the DAO gate should only ever report readiness for features the build knows about.\n\n## Novelty note\n\nNo ticket covers readiness / feature advertising. Closest, all verified: XE-1438 (QEMU/Lima VM managers \"report premature SLIRP readiness\" — VM guest-SSH readiness, a different subsystem and mechanism; the word \"readiness\" is the only overlap). GitHub live `search_issues` for readiness/feature-advertising returns 0 hits. Checked the live bounty board (High+Medium and Minor views) and the GitHub repo issues, 2026-11-12.\n\nRepo: github.com/xeprotocol/xe, HEAD 89a542e, testnet-0005.\n","patch_refs":[{"id":563,"repo":"xeprotocol/xe","kind":"pr","ref":"517","title":"fix(net,node): sanitize advertised peer features against KnownFeatureSet and cap list (fixes #510)","url":"https://github.com/xeprotocol/xe/pull/517","note":"","state":"open","author":"arturbarszcz78","added_by":"desk","created_at":"2026-11-14T20:42:20.160641+00:00"}],"thread":[{"id":13214,"source":"github","source_ref":"7026485927","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-13367 and says what differs; it is read like any other.","created_at":"2026-11-20T00:34:48+00:00"}]}