Loss of Veto Power can Lead to 51% Attack
The Governor contract lacks a zero-address check when initialising the vetoer and lacks a two-step process for changing the vetoer, so the owner could unintentionally lose veto power. This could open the DAO to a 51% attack that drains the treasury.
Submitted by TomJ, also found by 0xSky, ayeslick, Chom, pedr02b2, PwnPatrol, yixxas, and zkhorse
Governor.sol#L76 Governor.sol#L596-L602
The veto power is important functionality for current Nouns DAO logic 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 DAO owner losing their veto power unintentionally and open to 51% attack which can drain their entire treasury.
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() of Governor.sol Also I recommend to make changing address process of vetoer at updateVetoer() into 2-step process to avoid accidently setting vetoer to arbitrary address and end up lossing veto power unintentionally.
Governor.sol:
57: function initialize(
...
76: settings.vetoer = _vetoer;
596: function updateVetoer(address _newVetoer) external onlyOwner {
597: if (_newVetoer == address(0)) revert ADDRESS_ZERO();
599: emit VetoerUpdated(settings.vetoer, _newVetoer);
601: settings.vetoer = _newVetoer;
602: }
Recommended Mitigation Steps
Add zero address check for vetoer address at initialize(). Change updateVetoer() vetoer address changing process to 2-step process like explained below.
First make the updateVetoer() 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.
Alex the Entreprenerd (judge) commented:
Given the informations that we have, the settings that are available and the historical context, considering that the contract can allow burning the Vetoer, the Warden has demonstrated a risk that applies to all DAOs built via the factory, as well as other Governance Processes which share those traits.
Because this exploit is contingent on external factors, I think Medium Severity to be appropriate.
I personally believe that a Vetoer is a challenge toward a decentralized governance process, however I must agree with the evidence that a 51% attack is possible and has been exploited in the past via code similar to that which is in scope.
tbtstl (Nouns Builder) confirmed
kulkarohan (Nouns Builder) commented:
The zero-address check is done in
Manager.deploy()— see the following lines:I agree however that the vetoer should be set in 2-steps instead of directly.
kulkarohan (Nouns Builder) disagreed with severity and commented:
Believe this is QA IMO.
Alex the Entreprenerd (judge) commented:
Agree with the sponsor that 2 step checks are QA.
However, am choosing to keep the report as Med for the 51% attack part.
Historically this has been exploited and can create a dramatic impact.
My specific reasoning is that a 51% attack can happen, exclusively if Vetoer is removed, apathetic or malicious.
This guiding principle has opened up, for this specific contest, a set of decision that inherently create some attrition between me and the sponsor, specifically: this report, as well as #479 and #622.
My reasoning is that all of these findings are logically equivalent.
- There’s a risk of brute forcing the system
- To avoid the brute force we have a trusted third party
- The trusted third party creates a new set of complications
I can only empathize with the Sponsor in that the system does what it’s supposed to do, which is being a factory of Nouns DAO, at the same time, because of our rules, and the historical context of previous judging, Admin Privilege is a valid Medium Severity finding (as highlighted by other reports in this same contest and others).
Unfortunately Admin privilege in the case of governance falls onto the Vetoer, the one entity that is necessary to avoid a riskier (potentially) situation of a 51% attack. 51% voting power can be reached by bribing any time it’s economically feasible.
It is indeed circular logic, which to me reflects the current state of onChain governance. Which means I don’t have a clear mitigation.
For those reasons I can agree to disagree with the Sponsor and also recommend a nofix as at this time, with the given architecture, we either have a risk of Malicious Governance, Bribeable Voters, or risk of Malicious Vetoer.
When we talk about “Smart Contract” risk today, we can talk about Qualitative Risks and Quantitative Risks, the idea that a Vetoer could be malicious seems to fall into a Qualitative Risk, due to the bleeding-edge state of the tech and industry, I believe every person using the system is aware of those risks, however the acknowledgement of those risks doesn’t make it disappear.
This report and the two linked below also show a limitation of our current rules as well as the need to clarify what is “acceptable” Admin Privilege vs what is not.
Because of the context detailed above, I believe that I must judge those 3 findings equivalently, and while an argument for downgrading them to QA is legitimate, I believe that the correct severity, consistent over the organization’s lifetime (over 1 year and a half) is Medium Severity.
I understand other Auditors and projects offer a different rating (see Consensys Medium for Flagging staff up, vs our Medium which means Loss of Funds Conditional on External Conditions)
And I believe these findings will have to be discussed within the org to decide if Medium severity is appropriate. I’ll be flagging these findings up to discuss them with the broader community and discuss whether it is correct or appropriate for C4 to judge findings that ultimately “protect the end user” while they create attrition with the Sponsor.
While we have those discussions, at this time, C4 has prided itself in calling out unspoken risks that are inherent with a specific system (Smart Contract Risk), and in the case of the governor, as detailed by this report, #479 and #622 there’s an inherent risk which we made our best effort to quantify, and hopefully in talking about instead of taking it for granted, as a industry, we can find a way to build software that addresses these concerns.
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 check in initialize() and the single-step updateVetoer() function, which together allow the vetoer to be lost unintentionally.
Impact
If the vetoer is removed, apathetic or malicious, a 51% attack could pass and drain the treasury; the judge rated this Medium because it depends on external factors.
What the attacker needed
Vetoer removed, apathetic or malicious; 51% voting power reached
The fix
The zero-address check was said to be done in Manager.deploy(), and the sponsor agreed the vetoer should be set in two steps, but the judge recommended no fix at this time.
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.
A vetoer is a trusted address that can block malicious proposals in a DAO (a decentralised autonomous organisation). The report says the contract can set this address to zero or change it in one step, so a mistake could remove the protection. Without that protection, a group holding most voting power could pass a proposal to take all the 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.