<!-- XE-0685 · Flooding 1,000 chat messages to one account evicts the victim's entire chat history on that node · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0685>. The page is the record; this is the same page for reading.*

XE-0685 · Bounty

# Flooding 1,000 chat messages to one account evicts the victim's entire chat history on that node

Closed · duplicate
—claimed Minor
[xe#269](https://github.com/xeprotocol/xe/issues/269)
filed 2026-11-05 11:39 UTC
by rusdiwireng

Verdict
:   Duplicate

Tier
:   —

Claimed
:   Minor

Area
:   —

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-10 00:11 UTC

Told
:   2026-11-05 22:08 UTC

### Patches

None linked.

### History

- [9347](https://bounty.xe.network/log/9347) 2026-11-05 22:08 UTC github.state\_pushed
- [9346](https://bounty.xe.network/log/9346) 2026-11-05 22:08 UTC github.labels
- [9338](https://bounty.xe.network/log/9338) 2026-11-05 22:08 UTC reply.mirrored
- [9304](https://bounty.xe.network/log/9304) 2026-11-05 22:07 UTC reply.sent
- [9303](https://bounty.xe.network/log/9303) 2026-11-05 22:07 UTC proposal.adopted
- [9302](https://bounty.xe.network/log/9302) 2026-11-05 22:07 UTC proposal.adopted
- [9301](https://bounty.xe.network/log/9301) 2026-11-05 22:07 UTC ticket.status new → closed
- [9300](https://bounty.xe.network/log/9300) 2026-11-05 22:07 UTC proposal.adopted
- [9299](https://bounty.xe.network/log/9299) 2026-11-05 22:07 UTC ticket.facts
- [9298](https://bounty.xe.network/log/9298) 2026-11-05 22:07 UTC proposal.adopted
- [9297](https://bounty.xe.network/log/9297) 2026-11-05 22:07 UTC ticket.facts
- [7316](https://bounty.xe.network/log/7316) 2026-11-05 14:02 UTC proposal.created

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

### Report

Suggested severity tier: Low

Area: chat storage, chat/chat.go (storeFor), node/node.go (chat handler, NewChatStore)

Repository state checked: xeprotocol/xe HEAD 978785929bc17a2f4ab30c383e5fc9cf4d634512

## Summary

The chat store keeps at most 1,000 messages per account in a sliding window. When the window is full, each new message evicts the oldest one. Any sender can store a validly signed envelope addressed to any account, and there is no per-sender quota and no re-sync protocol for chat. Flooding 1,000 valid messages to one account therefore deletes that account's entire stored history on the receiving node, including messages the victim sent, with no way to recover them on that node.

## What was proven

storeFor in chat/chat.go (lines 72-83) drops the oldest message whenever the per-account list reaches maxPerAccount, which is 1,000 (node/node.go:314, chat.NewChatStore(1000)). Store in chat/chat.go (lines 30-60) performs no check on whether the sender is allowed to write to the destination account beyond envelope verification, and the account\_chat handler (node/node.go:2455-2470) stores any valid envelope it receives. There is no mechanism to re-sync chat history, so an evicted message is gone from GET /chat/messages on that node permanently.

Proven with a local test against the real ChatStore code: 1,000 legitimate messages were stored for one account, then 1,000 spam envelopes were flooded to the same account. After the flood, 0 of the 1,000 legitimate messages remained, and the oldest stored message was the first spam message. The test is TestR4ChatHistoryEviction, and it passes.

The cost was measured on this machine: minting and verifying one envelope at the default proof-of-work difficulty takes about 489 ms, so 1,000 envelopes cost about 8 minutes of CPU, and delivery takes about 20 seconds at the 50 messages per second per-peer rate limit (net/msg.go:52-53). Sending through POST /chat/send is slower, about 100 seconds at the 10 per second write bucket.

## Reproduction

1. Clone https://github.com/xeprotocol/xe and confirm HEAD is 978785929bc17a2f4ab30c383e5fc9cf4d634512.
2. Build a test harness against the chat package and store 1,000 legitimate messages for one account.
3. Deliver 1,000 validly signed envelopes addressed to that account.
4. Read the account's messages back and observe that none of the legitimate messages remain.

## Impact

The victim loses their chat history on the flooded node, including messages they sent themselves. No funds move, and no other account's messages become readable: reading still requires the victim's key proof (api/chat\_auth.go). Recovery is partial at best: the other party would have to send the messages again, and there is no re-sync protocol to pull them back. The cost to the attacker is real but modest, about 8 minutes of CPU plus delivery time, and parallel machines make it cheaper.

## Suggested fix

Add a per-sender quota inside the per-account window so one sender cannot evict another sender's messages, or keep a separate bounded list per sender. As a second step, add a chat re-sync path so a node can recover history it lost.

## Honest limits of this proof

The proof ran at the ChatStore level with the real code, and the account\_chat delivery path was read from code rather than executed between two nodes. A two-node run would confirm the end-to-end delivery, but the eviction mechanism itself is proven in the store. This report makes no claim about the public testnet, and the flood cost was measured on one local machine.

### Thread

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

Thanks. This is the same finding as https://bounty.xe.network/XE-0189, 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.
