[DAO] resolutions.propose and portal.decide allow direction-inverted, ops-mismatched, concurrent-withdrawal, and cancelled-session open-vote decisions
Report
Summary
Across dao/services/resolutions.py (propose) and dao/services/portal.py (_decision_resolution, decide), open-vote resolutions (adopt_open_vote, decline_open_vote) and proposal decisions (adopt, decline, refer, defer) fail to enforce agreement on target proposal, direction, operations (ops), concurrent withdrawal locking, and linked signing-session liveness:
- Unbound or dead-on-arrival open-vote resolutions at intake (
resolutions.propose):adopt_open_voteanddecline_open_votecan be proposed withoutrelated_proposal, ordecline_open_votecan carry executableops(opening aSigningSessionwhen passed even though the resolution declines the vote).adopt_open_votecan be proposed against an already-closed non-passed (outcome != "passed") or already-declined proposal, or against an ops-carrying proposal with mismatchedops(not portal.same_ops), causing the resolution to pass dead or execute divergent operations.
- Direction inversion and interim
refer/defermismatches inportal.decide:portal.decideallows recordingdecision="adopt"while citing adecline_open_voteresolution, ordecision="decline"while citing anadopt_open_vote(or ops-carrying) resolution.- Interim
refer/defercitations do not enforceadopt_open_voteoutcome andsame_opsagreement.
- TOCTOU withdrawal race and dead
SigningSessioncitation (portal._decision_resolution):_decision_resolutionreadsResolutionwithoutFOR UPDATE(populate_existing=True), allowing a concurrentwithdrawtransaction to raceportal.decide/refer.- When a passed resolution opened a
SigningSessionthat was subsequentlycancelledorfailed(so its on-chainopswill never execute),portal._decision_resolutionstill accepts that resolution as live authority to mark the proposaladopted.
Impact
A proposal decision recorded on public governance surfaces can invert the direction of the cited resolution, cite a resolution whose SigningSession was cancelled/failed and will never execute on-chain, race a concurrent resolution withdrawal, or open an executable SigningSession from a decline_open_vote resolution.
Thread
Proposed fix opened in https://github.com/xeprotocol/dao/pull/5.
Thanks. This is the same finding as https://bounty.xe.network/XE-11651, 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, file a new report that links https://bounty.xe.network/XE-13381 and says what differs; it is read like any other.