<!-- XE-0126 · net/banstore: FIFO 4096 ban table is flushable with 4096 throwaway identities — a live 24 h ban on a real offender is evicted · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0126>. The page is the record; this is the same page for reading.*

XE-0126 · Bounty

# net/banstore: FIFO 4096 ban table is flushable with 4096 throwaway identities — a live 24 h ban on a real offender is evicted

Triaging
claimed Minor
[xe#202](https://github.com/xeprotocol/xe/issues/202)
filed 2026-10-29 16:51 UTC
by hayokakoweda75

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Minor

Area
:   P2P / sync

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-08 20:17 UTC

Told
:   2026-11-08 20:18 UTC

### Patches

- [xe#208](https://github.com/xeprotocol/xe/pull/208) open by NePreby
  fix(net/banstore): protect security bans and retention floor against throwaway identity eviction (fixes #202)
- [xe#238](https://github.com/xeprotocol/xe/pull/238) open by tipprb
  fix(net/banstore): protect security bans and retention floor against throwaway identity eviction (fixes #202)

### History

- [43818](https://bounty.xe.network/log/43818) 2026-11-08 20:19 UTC reply.mirror\_failed
- [43777](https://bounty.xe.network/log/43777) 2026-11-08 20:18 UTC proposal.adopted
- [43776](https://bounty.xe.network/log/43776) 2026-11-08 20:18 UTC reply.sent
- [43207](https://bounty.xe.network/log/43207) 2026-11-08 20:18 UTC proposal.adopted
- [43206](https://bounty.xe.network/log/43206) 2026-11-08 20:18 UTC ticket.facts area
- [43205](https://bounty.xe.network/log/43205) 2026-11-08 20:18 UTC proposal.adopted
- [43204](https://bounty.xe.network/log/43204) 2026-11-08 20:18 UTC ticket.facts
- [43203](https://bounty.xe.network/log/43203) 2026-11-08 20:18 UTC proposal.adopted
- [43202](https://bounty.xe.network/log/43202) 2026-11-08 20:18 UTC ticket.facts
- [43201](https://bounty.xe.network/log/43201) 2026-11-08 20:18 UTC proposal.adopted
- [43200](https://bounty.xe.network/log/43200) 2026-11-08 20:18 UTC ticket.facts
- [43199](https://bounty.xe.network/log/43199) 2026-11-08 20:18 UTC proposal.adopted

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

### Report

**Suggested severity: Low (1,300 XE)**
**Area:** `net/banstore.go`
**Repo pin:** 9787859 (testnet-0005)

## Summary

The ban list is a bounded FIFO (4096). When it is full, the oldest ban is evicted to make room:

```
// net/banstore.go:129-141
for len(s.entries) >= s.max {
	if !s.evictOldestLocked() { break }
}
```

Bans are added by `netcheck` rejections, and an attacker controls how often those happen: one connection attempt with a fresh peer ID and a wrong answer is enough to earn an entry. Churning 4096 identities therefore flushes every existing ban, including long (24 h) bans on peers that were isolated for a reason.

Verified against the shipped store: a 24 h ban on one peer → `IsBanned=true`; after 4 200 throwaway bans → `live=4096, evictions=105`, `IsBanned(real offender)=false`. The persisted `bans.json` snapshot also keeps only 4096 entries, so the eviction survives restart.

## Impact

`network_id` / `sys.min_protocol_version` isolation becomes best-effort: a peer that was banned for speaking the wrong network or an old protocol can return after identity churn. Cost is roughly one connection plus one netcheck answer per ban (global limiter 32 RPS ≈ two minutes for the full flush).

## Fix

Keep a separate, non-evictable set for security bans (wrong network id / protocol version) with a longer TTL, or evict by a policy that prefers short-lived / low-severity entries and never removes a ban younger than some floor. Cap per-IP/ASN ban creation so a single actor cannot fill the table.

### Thread

**Joseph Denne**team2026-11-08 20:17 UTCdesk

Thanks for the report. We have confirmed the ban-table behaviour you describe and it is being handled; we will update this ticket when the fix is in.
