[High] net: unauthenticated wrong-chain admission (netcheck genesis_hash omission) + dirty-flag poisoning force perpetual full-mesh resync — composes with #44 and #202 into an unmitigable DoS
Report
Suggested severity: High (unauthenticated, remote, persistent; composes with #44 and #202 into an unmitigable DoS — see Composition)
Duplicate check: swept the full live tracker (gh issue list --state all). The two defects claimed here are not reported: no issue covers the netcheck genesis-hash omission, and none covers inbound sync requests poisoning the sync tracker's dirty flag. Related, already-tracked stages are referenced below and explicitly not re-claimed.
Reviewed at commit 02e9641b0ac64437f57e09d63301f88cce61a802 (2026-11-03).
Defect 1 — netcheck genesis check is opt-in for the remote peer → wrong-chain peers admitted
net/netcheck.go:366:
if ours.GenesisHash != "" && msg.GenesisHash != "" && msg.GenesisHash != ours.GenesisHash {
return fmt.Sprintf("statechain genesis mismatch ..."), defaultBanDur
}
A peer on a different chain (different genesis) with the same network_id simply omits genesis_hash and passes every check. It stays connected, can sync, gossip, and drive Defect 2 below.
Observed (PoC against a copy of the repo, original untouched):
wrong-genesis peer with genesis_hash omitted -> reason="" ban=0s
CONFIRMED: admitted
Defect 2 — one unauthenticated inbound sync request poisons the dirty flag → perpetual full-mesh resync
net/sync.go:459-475 (handleSyncStream) + :478-508 (frontiersWhereServerIsBehind):
behind := frontiersWhereServerIsBehind(req.Frontiers, ledger)
...
if tracker != nil && len(behind) > 0 { tracker.MarkDirty() }
frontiersWhereServerIsBehind marks the server "behind" for any account it holds whose remote frontier is a 64-hex string that is neither our frontier nor in our chain. Accounts are publicly enumerable (GET /accounts, GET /frontiers, gossip). MarkDirty() then makes the periodic loop (:345-384) sync with every connected peer every 10 s — re-armed each 5 s by the next request, because the inbound limiter is per-peer-ID and identities are free.
Observed:
CONFIRMED: single unauthenticated inbound sync request set the dirty flag
Trigger cost: ~270 bytes, no authentication beyond a completed libp2p handshake.
Composition — why this is filed as High
Neither defect alone is a crash. Composed with two already-tracked defects they form an attack with no mitigation path:
- #201 (DHT discovery DoS) and the unauthenticated
xe/discovery/1/<networkID>rendezvous namespace (net/discovery.go:94-135,round()dials every returned record with no admission check) let the attacker fill the victim's peer set with its own nodes; - Defect 1 keeps those nodes admitted even when they are on the wrong chain;
- Defect 2 converts each of them into a perpetual resync trigger;
- #44 (already tracked) is the memory-exhaustion stage those resyncs feed;
- #202 (already tracked) is why the victim cannot ban the attackers: 4096 throwaway identities evict legitimate bans FIFO in ~2 minutes.
The node's answer to a malicious peer — banning — is defeated by #202, and the reconnaissance step is free via the public read endpoints. What is new in this report is the admission bypass (Defect 1), the 270-byte trigger (Defect 2), and the composition argument.
Fix direction: (1) require genesis_hash when the local node has one — reject peers that omit it; (2) require proof-of-work or a pre-existing authenticated connection for inbound sync requests, and rate-limit MarkDirty per peer; (3) treat the dirty flag as a hint, not a command, when set by an unauthenticated remote.
Thread
Thanks. This is the same finding as https://bounty.xe.network/XE-0232, 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, reply with what differs and we will look again.