changeDAO should be a two-step process in Vader.sol
The changeDAO function updates the DAO address in a single step, so if an incorrect address is set, administrative access could be permanently lost because only the wrong DAO can call changeDAO again. An attacker who gains control of the DAO could exploit this to lock out the legitimate DAO, though the report notes this requires multiple failures.
Vader Protocol contest
Originally disclosed on Code4rena
changeDAO() updates DAO address in one-step. If an incorrect address is mistakenly used (and voted upon) then future administrative access or recovering from this mistake is prevented because onlyDAO modifier is used for changeDAO(), which requires msg.sender to be the incorrectly used DAO address (for which private keys may not be available to sign transactions). See finding #6 from Trail of Bits audit of Hermez Network.
Recommend using a two-step process where the old DAO address first proposes new ownership in one transaction; and then, accepts ownership from the newly proposed DAO address in a second transaction. A mistake in the first step can be recovered by granting with a new correct address again before the new DAO address accepts ownership. Ideally, there should also be a timelock enforced before the new DAO takes effect.
strictly-scarce (vader) confirmed:
A lot has to go wrong to get to this point, so disagree with severity (funds not at risk).
Two step-process seems wise though.
Risk lowered because of the extremely low probability
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 changeDAO function updates the DAO address in a single step without a confirmation or timelock, and the onlyDAO modifier then restricts further changes to the new (possibly incorrect) address.
Impact
If an incorrect DAO address is set, administrative access could be permanently lost, but the report notes this requires multiple failures and is extremely unlikely.
What the attacker needed
DAO vote to change address; incorrect address proposed and voted upon; private keys for incorrect address unavailable
The fix
The function should be changed to a two-step process where the old DAO proposes a new owner and the new owner accepts, ideally with a timelock.
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 smart contract has a special function to change who controls it. This report says that function should require two steps: first propose a new controller, then have the new controller accept. Without the second step, a simple typo could permanently lock everyone out.
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.