<!-- XE-0034 · dao: proposal fee accepted on an unfinalized send; a rollback frees the author to respend it (Medium) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0034>. The page is the record; this is the same page for reading.*

XE-0034 · Bounty

# dao: proposal fee accepted on an unfinalized send; a rollback frees the author to respend it (Medium)

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

Verdict
:   Valid

Tier
:   Medium

Claimed
:   Medium

Area
:   DAO harness

Duplicate of
:   —

Tracked
:   internally

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

Updated
:   2026-11-10 00:11 UTC

Told
:   2026-10-30 08:21 UTC

### Patches

- [xe#56](https://github.com/xeprotocol/xe/pull/56) open by ahmed-aneem
  fix: dao: proposal fee accepted on an unfinalized send; a rollback frees the author to respend it (Medium)
- [dao@fd2b0d5f0e](https://github.com/xeprotocol/dao/commit/fd2b0d5f0ed1a3dbf0a11a9b33ce3cb7a1741c8d)

### History

- [2620](https://bounty.xe.network/log/2620) 2026-11-04 01:27 UTC github.labels
- [2618](https://bounty.xe.network/log/2618) 2026-11-04 01:27 UTC proposal.adopted
- [2617](https://bounty.xe.network/log/2617) 2026-11-04 01:27 UTC ticket.status patched → awarded
- [2616](https://bounty.xe.network/log/2616) 2026-11-04 01:27 UTC ticket.status accepted → patched
- [2575](https://bounty.xe.network/log/2575) 2026-11-03 19:29 UTC proposal.created
- [2167](https://bounty.xe.network/log/2167) 2026-11-03 01:23 UTC github.labels
- [2152](https://bounty.xe.network/log/2152) 2026-11-03 01:22 UTC ticket.status awarded → accepted
- [1149](https://bounty.xe.network/log/1149) 2026-10-31 11:14 UTC github.labels
- [1145](https://bounty.xe.network/log/1145) 2026-10-31 11:14 UTC ticket.status patched → awarded
- [1140](https://bounty.xe.network/log/1140) 2026-10-31 11:11 UTC ticket.facts assignee\_id
- [1136](https://bounty.xe.network/log/1136) 2026-10-31 11:06 UTC ticket.award
- [1069](https://bounty.xe.network/log/1069) 2026-10-30 01:41 UTC github.labels

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

### Report

## Summary

The DAO proposal endpoint verifies the fee by reading the fee block from the node API and checking type, asset, destination, source and amount, but never reads the block's finalized flag. A send that is visible but not final satisfies the check. An author can open a proposal backed by a send that later loses a conflict and is rolled back; the fee account never receives, and the proposal stays open for the full window.

## Affected component

dao/services/portal.py, \_verify\_fee at lines 43 to 69 (no finalized check) and submit from line 72; the node already exposes Finalized on GET /blocks/{hash} (api/handler.go lines 515 to 527 at the xe pin), 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

One open proposal per fee-free author per window (default window is multi-week). The DAO never receives the 10 XE fee for a proposal that stays open and votable. No treasury theft: the fee account simply never receives, and the proposal eventually closes unpaid.

Suggested severity: Medium (validation gap on a 10 XE advisory-portal fee). 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
"""F21: DAO _verify_fee accepts a send and never reads the finalized flag."""
from __future__ import annotations

import asyncio
import os
import sys
from types import SimpleNamespace

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

from dao.services.portal import _verify_fee  # noqa: E402

class FakeResult:
    def first(self):
        return None

class FakeDB:
    async def execute(self, stmt):
        return FakeResult()

class FakeChain:
    def __init__(self, block: dict):
        self._block = block

    async def block(self, fee_block_hash: str) -> dict:
        return self._block

async def run() -> int:
    fee_acct = "ff" * 32
    author = "aa" * 32
    fee_hash = "bb" * 32
    unfinalized = {
        "hash": fee_hash,
        "type": "send",
        "asset": "XE",
        "destination": fee_acct,
        "account": author,
        "amount": 10_000_000,
        "finalized": False,
        "previous": "cc" * 32,
    }
    ctx = SimpleNamespace(
        signer=SimpleNamespace(has=lambda k: False),
        config=SimpleNamespace(accounts={"fee": fee_acct}),
        chain=FakeChain(unfinalized),
    )
    got = await _verify_fee(ctx, FakeDB(), fee_hash, author, fee=10_000_000)
    print(
        f"fee_block finalized={got.get('finalized')!r} type={got.get('type')} "
        f"amount={got.get('amount')} keys={sorted(got)}"
    )
    if got.get("finalized") is False and got.get("type") == "send":
        print("PASS: F21 _verify_fee accepted an unfinalized send (finalized flag ignored)")
        return 0
    print("FAIL: F21 expected _verify_fee to return the unfinalized send")
    return 0

if __name__ == "__main__":
    raise SystemExit(asyncio.run(run()))
```

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

```
fee_block finalized=False type=send amount=10000000 keys=['account', 'amount', 'asset', 'destination', 'finalized', 'hash', 'previous', 'type']
PASS: F21 _verify_fee accepted an unfinalized send (finalized flag ignored)
```

## Fix suggestion

Require Finalized is true (or a receive block on the fee account) in \_verify\_fee before accepting the proposal.

### Thread

**Joseph Denne**2026-10-30 01:16 UTCgithub

Thanks, confirmed. \_verify\_fee does not read the block's finalized flag, and we found the settlement side has the same gap: a fee row that was never received into the fee account is still refunded or burned at close. Both are being fixed together: a finalized check at submission and a receive check before any refund or burn. We will post the commit on this issue 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.
