Bounty
XE-13367 · Bounty

Laporan bug

Closed · duplicate — xe#510 filed 2026-11-12 16:21 UTC by Gib230223

Report

XE Bounty — Laporan siap file (temuan pass 5 #3, subagent C)

File issue baru di: https://github.com/xeprotocol/xe/issues/new Paste judul + isi di bawah. Akun GitHub: Gib230223.


Judul

[Low] DAO readiness gate trusts self-asserted peer features — a representative can push a nonexistent feature to 1000/1000 ready

Isi

Summary

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.

Evidence

// net/netcheck.go:415,471 — both handshake directions store msg.Features verbatim:
gater.RecordPeerCapabilities(pid, PeerCapabilities{Version: msg.Version, Features: msg.Features})

// net/netcheck.go:354 checkPeer — validates network_id, genesis, version; never looks at Features.
func checkPeer(msg netcheckMsg, ours netcheckMsg) (reason string, banDuration time.Duration) {
    // ... network_id / genesis / version checks only ...
    return "", 0
}

// net/features.go:68-72 — maxAdvertisedFeatures=8 caps only the LOCAL list:
var LocalFeatures = sync.OnceValue(func() []string {
    f := core.KnownFeatures()
    if len(f) > maxAdvertisedFeatures { f = f[:maxAdvertisedFeatures] }
    return f
})

// node/activations.go:185 — GetReadiness sums delegated weight per advertised string, no validation:
for _, f := range c.Features {
    info.FeatureWeight[f] += w
}
// ... then FeatureReadyMilli[f] = w * 1000 / info.TotalWeight
// api/handler.go:151 — the endpoint's documented purpose:
{"GET", "/network/readiness", "Delegated vote weight by advertised version and feature — the gate the DAO reads before signing an activation", h.handleGetReadiness},

Note 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.

Impact (Low)

A 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.

Reproduction (PoC)

Unit 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.

Coordinator 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):

setup: rep 4be745caebb6 holds 10000000000000000 uXE of delegated weight
BUG: nonexistent feature 'fake-feature-xyz' reports weight=10000000000000000, ready=995/1000 (total weight=10042000000000000)
--- PASS: TestPoc5ReadinessFakeFeature (0.00s)

Suggested fix

Validate 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.

Novelty note

No 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.

Repo: github.com/xeprotocol/xe, HEAD 89a542e, testnet-0005.

Thread

Joseph Denneteam2026-11-20 00:34 UTCgithub

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-13367 and says what differs; it is read like any other.