<!-- XE-0446 · [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 · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0446>. The page is the record; this is the same page for reading.*

XE-0446 · Bounty

# \[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

Closed · duplicate
—claimed High
[xe#254](https://github.com/xeprotocol/xe/issues/254)
filed 2026-11-04 09:24 UTC
by Fahri Raditya Arrifudin

Verdict
:   Duplicate

Tier
:   —

Claimed
:   High

Area
:   —

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-10 00:11 UTC

Told
:   2026-11-05 22:07 UTC

### Patches

- [xe#265](https://github.com/xeprotocol/xe/pull/265) open by tipprb
  fix(net): require genesis\_hash in netcheck and gate inbound sync dirty-flag triggers (fixes #254)

### History

- [9351](https://bounty.xe.network/log/9351) 2026-11-05 22:08 UTC github.state\_pushed
- [9350](https://bounty.xe.network/log/9350) 2026-11-05 22:08 UTC github.labels
- [9204](https://bounty.xe.network/log/9204) 2026-11-05 22:07 UTC reply.mirrored
- [9161](https://bounty.xe.network/log/9161) 2026-11-05 22:07 UTC reply.sent
- [9160](https://bounty.xe.network/log/9160) 2026-11-05 22:07 UTC proposal.adopted
- [9159](https://bounty.xe.network/log/9159) 2026-11-05 22:07 UTC proposal.adopted
- [9158](https://bounty.xe.network/log/9158) 2026-11-05 22:07 UTC ticket.status triaging → closed
- [9157](https://bounty.xe.network/log/9157) 2026-11-05 22:07 UTC proposal.adopted
- [9156](https://bounty.xe.network/log/9156) 2026-11-05 22:07 UTC ticket.facts
- [9155](https://bounty.xe.network/log/9155) 2026-11-05 22:07 UTC proposal.adopted
- [9154](https://bounty.xe.network/log/9154) 2026-11-05 22:07 UTC ticket.facts
- [7252](https://bounty.xe.network/log/7252) 2026-11-05 14:02 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-0446) · [JSON](https://bounty.xe.network/v1/tickets/XE-0446) · [markdown](https://bounty.xe.network/XE-0446.md)

### 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

**Joseph Denne**team2026-11-05 22:07 UTCgithub

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.
