Loss of Veto Power can Lead to 51% Attack
The vetoer address in NounsDAO governance contracts could be set to the zero address or an arbitrary address because there was no zero-address check and no two-step transfer process. This could unintentionally remove the veto power, potentially exposing the treasury to a 51% attack.
Submitted by TomJ, also found by 0xDjango, 0xSmartContract, Aymen0909, Ch_301, and Deivitto
Impact
The veto power is import functionality for current NounsDAO in order to protect their treasury from malicious proposals. However there is lack of zero address check and lack of 2 step address changing process for vetoer address. This might lead to Nounders losing their veto power unintentionally and open to 51% attack which can drain their entire treasury.
Refrence from Nouns DAO contest documents: https://dialectic.ch/editorial/nouns-governance-attack https://dialectic.ch/editorial/nouns-governance-attack-2
Proof of Concept
Lack of 0-address check for vetoer address at initialize() and \_setVetoer() of NounsDAOLogicV2.sol and NounsDAOLogicV1.sol. Also it is better to make changing address process of vetoer at \_setVetoer() into 2-step process to avoid accidently setting vetoer to zero address or any other arbitrary addresses and end up burning/losing veto power unintentionally.
- Vetoer address of
initialize()of NounsDAOLogicV2.sol, NounsDAOLogicV1.sol
- Vetoer address of
\_setVetoer()of NounsDAOLogicV2.sol, NounsDAOLogicV1.sol
Recommended Mitigation Steps
Add zero address check for vetoer address at initialize(). Also change \_setVetoer() vetoer address changing process to 2-step process like explained below.
First make the \_setVetoer() function approve a new vetoer address as a pending vetoer. Next that pending vetoer has to claim the ownership in a separate transaction to be a new vetoer.
eladmallel (Nouns DAO) confirmed and commented:
We agree it’s worth being extra safe here, planning to change it to a 2-step process.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the missing zero-address validation and the single-step transfer of the vetoer role allow the veto power to be lost accidentally.
Impact
The veto power could be lost unintentionally, which may open the DAO to a 51% attack that could drain the entire treasury.
What the attacker needed
Access to setVetoer function; or initialization with zero address
The fix
Add a zero-address check in initialize and change the vetoer transfer to a two-step process where a pending vetoer must claim the role.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
In a DAO, a special account called the vetoer can block malicious proposals to protect the treasury. The code that sets this account did not check for mistakes like setting it to an empty address, and it changed the account in one step. A mistake could remove the vetoer, and then a group with enough voting power could pass a proposal to drain all funds.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.