Reproduced Exploit
DXdao: split no-votes let a 50-vote action take a 100 token treasury
EnforcedBinaryGuild.createProposal does totalActions.add(1) for the enforced no-vote, then BaseERC20Guild does totalActions.add(1) again because action 0 is already no. totalVotes has length 3. A 50-vote yes beats 40 and 40 on the two no slots, and the guild calls transfer of its 100 token balance.…
Loss
Guild treasury of 100 tokens is transferred. Combined no votes were 80 against a yes of 50
Chain
Ethereum
Category
logic
Date
Jun 2022
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 19346-duplicate-actions-unaccounted-for-during-voting-tally-sigmap. Standalone Foundry PoC and full write-up: 19346-duplicate-actions-unaccounted-for-during-voting-tally-sigmap_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/logic/missing-check
Key info#
| Field | Value |
|---|---|
| Loss | Guild treasury of 100 tokens is transferred. Combined no votes were 80 against a yes of 50 |
| Vulnerable contract | EnforcedBinaryGuild.createProposal |
| Attacker EOA | 0x1111111111111111111111111111111111111111 |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2022-06 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | Two no-action slots are tallied separately |
TL;DR#
EnforcedBinaryGuild.createProposal does totalActions.add(1) for the enforced no-vote, then BaseERC20Guild does totalActions.add(1) again because action 0 is already no. totalVotes has length 3. A 50-vote yes beats 40 and 40 on the two no slots, and the guild calls transfer of its 100 token balance. Summing the no slots would be 80 and the proposal would be rejected.
The vulnerable code#
uint256 totalActions = 1;
totalActions = totalActions.add(1); // @> VULN: child adds a no-action the parent already adds
p.totalVotes = new uint256[](totalActions.add(1));
The parent line is the baseline. The child line is the duplicate. endProposal selects the maximum slot and does not add index 0 to the last index.
Root cause#
The no-action is inserted twice, once in the child and once in the parent, and the tally never reconciles those two indexes.
Preconditions#
- The proposal has one real action: transfer 100 tokens from the guild to the proposer.
- Votes are 40 on slot 0, 50 on slot 1, and 40 on slot 2.
- The guild holds 100 tokens.
Attack walkthrough#
- Create the proposal.
totalVotes.lengthis 3. - Cast the split no votes and the yes vote.
endProposalselects slot 1.- The guild calls
transferand its balance becomes 0. - The control creates a proposal without the extra add, puts 80 on the single no slot and 50 on yes, and
endProposalreverts withrejected.
Diagrams#
Impact#
A proposal passes even though more weight voted no than yes, whenever the no weight is split across the two reject slots. Here that transfers the guild's entire 100 token treasury to the proposer. The contracts were later removed, which is the resolution recorded in the review.
Remediation#
Add the extra no-action in only one contract. If both slots remain, endProposal must sum index 0 and the last index before it picks a winner.
How to reproduce#
cd 19346-duplicate-actions-unaccounted-for-during-voting-tally-sigmap_exp
forge test -vv
Captured output is output.txt.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/19346-duplicate-actions-unaccounted-for-during-voting-tally-sigmap.md
- Sigma Prime DXdao ERC20 guild review: https://github.com/sigp/public-audits/blob/master/dxdao/erc20-guild/review.pdf
- Taxonomy on the finding: genome duplicate-mutable-accounts, variant, role-bypass, account-ownership, pda-derivation. Tags severity/high, sector/governance, sector/token, platform/sigmaprime, vuln/pda/duplicate-mutable-accounts. The pda labels are the finding's stored tags. The mechanism is the duplicate no-action slot in the guild tally.
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 19346-duplicate-actions-unaccounted-for-during-voting-tally-sigmap_exp (evm-hack-registry mirror).
- AuditVault finding: 19346-duplicate-actions-unaccounted-for-during-voting-tally-sigmap.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.