{"id":"XE-0034","kind":"bounty","visibility":"public","source":"github","source_repo":"xeprotocol/xe","source_ref":"55","source_url":"https://github.com/xeprotocol/xe/issues/55","reporter_id":13,"title":"dao: proposal fee accepted on an unfinalized send; a rollback frees the author to respend it (Medium)","area":"dao-harness","claimed_tier":"medium","assessed_tier":"medium","verdict":"valid","duplicate_of":null,"tracked":true,"internal_ref":"#1073","internal_url":"https://github.com/xeprotocol/core/issues/1073","status":"awarded","closed_reason":null,"github_state":"open","disclosed_at":null,"award_xe":2000000000,"award_approved":true,"paid_ref":"","created_at":"2026-10-29T13:57:16.806097+00:00","updated_at":"2026-11-10T00:11:26.732878+00:00","source_created_at":"2026-10-25T11:12:40+00:00","told_at":"2026-10-30T08:21:59+00:00","status_changed_at":"2026-11-04T01:27:07.834197+00:00","url":"https://bounty.xe.network/XE-0034","body":"## Summary\nThe 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.\n\n## Affected component\ndao/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\nThe 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.\n\n## Impact\nOne 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.\n\nSuggested severity: Medium (validation gap on a 10 XE advisory-portal fee). Confirmed by read-only source review with an in-process harness.\n\n## PoC\n## PoC\n\n**Script** (clone the dao repository as a sibling checkout directory and adjust the path line inside the script if your layout differs):\n\n```python\n#!/usr/bin/env python3\n\"\"\"F21: DAO _verify_fee accepts a send and never reads the finalized flag.\"\"\"\nfrom __future__ import annotations\n\nimport asyncio\nimport os\nimport sys\nfrom types import SimpleNamespace\n\nsys.path.insert(0, os.path.join(os.path.dirname(__file__), \"..\", \"ws\", \"dao\"))\n\nfrom dao.services.portal import _verify_fee  # noqa: E402\n\n\nclass FakeResult:\n    def first(self):\n        return None\n\n\nclass FakeDB:\n    async def execute(self, stmt):\n        return FakeResult()\n\n\nclass FakeChain:\n    def __init__(self, block: dict):\n        self._block = block\n\n    async def block(self, fee_block_hash: str) -> dict:\n        return self._block\n\n\nasync def run() -> int:\n    fee_acct = \"ff\" * 32\n    author = \"aa\" * 32\n    fee_hash = \"bb\" * 32\n    unfinalized = {\n        \"hash\": fee_hash,\n        \"type\": \"send\",\n        \"asset\": \"XE\",\n        \"destination\": fee_acct,\n        \"account\": author,\n        \"amount\": 10_000_000,\n        \"finalized\": False,\n        \"previous\": \"cc\" * 32,\n    }\n    ctx = SimpleNamespace(\n        signer=SimpleNamespace(has=lambda k: False),\n        config=SimpleNamespace(accounts={\"fee\": fee_acct}),\n        chain=FakeChain(unfinalized),\n    )\n    got = await _verify_fee(ctx, FakeDB(), fee_hash, author, fee=10_000_000)\n    print(\n        f\"fee_block finalized={got.get('finalized')!r} type={got.get('type')} \"\n        f\"amount={got.get('amount')} keys={sorted(got)}\"\n    )\n    if got.get(\"finalized\") is False and got.get(\"type\") == \"send\":\n        print(\"PASS: F21 _verify_fee accepted an unfinalized send (finalized flag ignored)\")\n        return 0\n    print(\"FAIL: F21 expected _verify_fee to return the unfinalized send\")\n    return 0\n\n\nif __name__ == \"__main__\":\n    raise SystemExit(asyncio.run(run()))\n```\n\n**Run** (run 1 of 5 consecutive runs, 5/5 PASS, exit 0):\n\n```\nfee_block finalized=False type=send amount=10000000 keys=['account', 'amount', 'asset', 'destination', 'finalized', 'hash', 'previous', 'type']\nPASS: F21 _verify_fee accepted an unfinalized send (finalized flag ignored)\n```\n\n## Fix suggestion\nRequire Finalized is true (or a receive block on the fee account) in _verify_fee before accepting the proposal.","patch_refs":[{"id":123,"repo":"xeprotocol/xe","kind":"pr","ref":"56","title":"fix: dao: proposal fee accepted on an unfinalized send; a rollback frees the author to respend it (Medium)","url":"https://github.com/xeprotocol/xe/pull/56","note":"","state":"open","author":"ahmed-aneem","added_by":"desk","created_at":"2026-10-29T13:57:30.091343+00:00"},{"id":216,"repo":"xeprotocol/dao","kind":"commit","ref":"fd2b0d5f0ed1a3dbf0a11a9b33ce3cb7a1741c8d","title":"","url":"https://github.com/xeprotocol/dao/commit/fd2b0d5f0ed1a3dbf0a11a9b33ce3cb7a1741c8d","note":"","state":"","author":"","added_by":"token:5","created_at":"2026-10-30T01:39:15.899099+00:00"}],"thread":[{"id":58,"source":"github","source_ref":"6512504753","author":"Joseph Denne","team":false,"body":"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.","created_at":"2026-10-30T01:16:03+00:00"},{"id":63,"source":"github","source_ref":"6518125459","author":"josephdenne","team":true,"body":"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.","created_at":"2026-10-30T08:08:47+00:00"},{"id":67,"source":"github","source_ref":"6518391951","author":"josephdenne","team":true,"body":"This fix is now live on dao.test.network.","created_at":"2026-10-30T08:21:59+00:00"}]}