<!-- XE-0033 · dao: vote replay cache is a process-local 50k FIFO; an evicted signature replays inside the 10 minute window (Medium) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0033>. The page is the record; this is the same page for reading.*

XE-0033 · Bounty

# dao: vote replay cache is a process-local 50k FIFO; an evicted signature replays inside the 10 minute window (Medium)

Awarded
Medium
[xe#51](https://github.com/xeprotocol/xe/issues/51)
filed 2026-10-25 11:12 UTC
by byfor8

Verdict
:   Valid

Tier
:   Medium

Claimed
:   Medium

Area
:   DAO harness

Duplicate of
:   —

Tracked
:   internally

Award
:   1,500 XE approved
    · ceiling 2,500

Updated
:   2026-11-10 00:11 UTC

Told
:   2026-10-30 08:21 UTC

### Patches

- [dao@fd2b0d5f0e](https://github.com/xeprotocol/dao/commit/fd2b0d5f0ed1a3dbf0a11a9b33ce3cb7a1741c8d)

### History

- [2619](https://bounty.xe.network/log/2619) 2026-11-04 01:27 UTC github.labels
- [2615](https://bounty.xe.network/log/2615) 2026-11-04 01:26 UTC proposal.adopted
- [2614](https://bounty.xe.network/log/2614) 2026-11-04 01:26 UTC ticket.status patched → awarded
- [2613](https://bounty.xe.network/log/2613) 2026-11-04 01:26 UTC ticket.status accepted → patched
- [2574](https://bounty.xe.network/log/2574) 2026-11-03 19:29 UTC proposal.created
- [2166](https://bounty.xe.network/log/2166) 2026-11-03 01:23 UTC github.labels
- [2151](https://bounty.xe.network/log/2151) 2026-11-03 01:22 UTC ticket.status awarded → accepted
- [1148](https://bounty.xe.network/log/1148) 2026-10-31 11:14 UTC github.labels
- [1144](https://bounty.xe.network/log/1144) 2026-10-31 11:14 UTC ticket.status patched → awarded
- [1139](https://bounty.xe.network/log/1139) 2026-10-31 11:11 UTC ticket.facts assignee\_id
- [1130](https://bounty.xe.network/log/1130) 2026-10-31 10:47 UTC ticket.award
- [1129](https://bounty.xe.network/log/1129) 2026-10-31 10:47 UTC ticket.award

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

### Report

## Summary

The DAO API's replay protection is a process-local OrderedDict of signature hexes capped at 50000 entries, evicted first-in-first-out, and it dies on restart. Vote signatures are published verbatim by the votes endpoint, so any seat holder's captured vote signature can be replayed once the cache has been flushed by a restart or flooded out by 50001 unique self-signed requests (the public inbox POST is a free eviction source).

## Affected component

dao/auth.py, \_Seen at lines 52 to 84 and the check\_and\_add call at line 83; dao/api/public.py, votes route returning the raw signature at lines 126 to 133; window is MAX\_SKEW\_NS, 10 minutes (auth.py), at dao commit c60cf81522e3eb9e258b353e77164a3f7634cd98. \## Scope note
The dao service is the governance backend named in the program's "state chain and multisig governance" scope row; flagging that the dao repository itself is not separately named on the bounty page.

## Impact

A replayed FOR vote inside the 10 minute window replaces an AGAINST ballot on an advisory portal vote. Portal votes are advisory (nothing executes automatically), so this is integrity of a replaceable ballot, not a treasury move. Max loss: one flipped advisory vote per captured signature per 10 minute window.

Suggested severity: Medium (validation gap). Confirmed by read-only source review with an in-process harness.

## PoC

## PoC

**Script** (clone the dao repository as a sibling checkout directory and adjust the path line inside the script if your layout differs):

```
#!/usr/bin/env python3
"""F14: DAO vote replay cache is a process-local FIFO of signature hexes."""
from __future__ import annotations

import os
import sys

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "ws", "dao"))

from dao.auth import _Seen  # noqa: E402

def main() -> int:
    # Tiny cap so eviction is visible without 50_001 inbox posts.
    seen = _Seen(cap=3)
    vote_sig = "aa" * 32
    first = seen.check_and_add(vote_sig)
    replay_before = seen.check_and_add(vote_sig)
    for i in range(3):
        seen.check_and_add(f"{i:064x}")
    replay_after_evict = seen.check_and_add(vote_sig)

    print(
        f"cap={seen.cap} first_add={first} immediate_replay={replay_before} "
        f"replay_after_fifo_evict={replay_after_evict}"
    )
    if first is True and replay_before is False and replay_after_evict is True:
        print("PASS: F14 _Seen is RAM FIFO; evicting the vote sig lets the same hex replay")
        return 0
    print("FAIL: F14 expected first=True, immediate replay=False, post-eviction replay=True")
    return 0

if __name__ == "__main__":
    raise SystemExit(main())
```

**Run** (run 1 of 5 consecutive runs, 5/5 PASS, exit 0):

```
cap=3 first_add=True immediate_replay=False replay_after_fifo_evict=True
PASS: F14 _Seen is RAM FIFO; evicting the vote sig lets the same hex replay
```

## Fix suggestion

Persist the replay cache (or key it by signature in the database with a unique index), and stop returning raw signatures on public vote reads.

### Thread

**Joseph Denne**2026-10-30 00:47 UTCgithub

Thanks, confirmed. The replay set is per process and bounded, and we also found that a replayed older vote overwrites a newer one because portal.vote does not compare timestamps. The fix is a monotonic timestamp rule on votes plus a persisted seen-signature table with a purge after the skew window. Vote signatures will stay public, since with those two changes they are safe to publish and they are what lets anyone check the tally. We will post the commit here when it lands.

**josephdenne**team2026-10-30 08:08 UTCgithub

Fix is on main: https://github.com/xeprotocol/dao/commit/fd2b0d5f0ed1a3dbf0a11a9b33ce3cb7a1741c8d. Deploying to dao.test.network next; this issue will be updated once it is live.

**josephdenne**team2026-10-30 08:21 UTCgithub

This fix is now live on dao.test.network.
