Changing treasury owner through transferOwnership() can break Governer.sol and Auction.sol
The treasury can call transferOwnership on the Governor and Auction contracts, but this does not update the treasury address stored in settings. If a governance proposal changes ownership, subsequent proposals will still call the old treasury, preventing parameter changes and sending auction proceeds to the wrong address.
Submitted by scaraven
Governor.sol#L21 Ownable.sol#L63 Auction.sol#L22
governor.transferOwnership() and Auction.transferOwnership() is exposed to Treasury.sol and can be called in a governance proposal. If this is used then it causes an inconsistency between the owner of these contracts and settings.treasury which would prevent governance from ever modifying its own parameters and Ethereum from auctions will be sent to the wrong address.
I believe medium severity is suitable because we lose partial control of governance and/or ETH from auctions, assuming that a proposal (malicious or not) is passed which changes contract ownership.
Proof of Concept
- A proposal which calls
governor.transferOwnership()is executed and transfers ownership to a new treasury address - When subsequent proposals are passed,
Governor.solwill make an external call tosettings.treasurywhich is not modified when ownership is passed - Therefore,
settings.treasuryis not able to modify any governance parameters such asproposalThreshold
The same issue applies to Auction.sol.
Tools Used
VS Code
Recommended Mitigation Steps
Modify transferOwnership() in the relevant contracts so that if ownership is transferred, then settings.treasury is changed accordingly.
kulkarohan (Nouns Builder) acknowledged
Alex the Entreprenerd (judge) commented:
The Warden has shown how, due to the possibility of decoupling Treasury and Governor via Upgradeable.transferOwnership Auction.treasury may be set to the wrong address.
Personally I think that the decoupling between Auction, Governor and Treasury should be removed as ultimately this system is meant to be “immutable” and a migration could be achieved via a full redeploy and then a proposal to transfer funds.
However, the situation described by the Warden can happen and in those cases funds would be lost or sent to the wrong contract.
Because a timelock needs to vote this, I’m inclined to reduce severity.
However, because the contract functionality allows Ownership Transfer by default, but there’s no custom code to update the settings, I think Medium Severity is appropriate as in certain cases the contract will not behave as intended.
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
The transferOwnership function does not update the treasury address stored in settings, creating a mismatch between the contract owner and the treasury used for calls.
Impact
If a proposal changes ownership, governance loses partial control and auction ETH could be sent to the wrong address, though a timelock vote is required.
What the attacker needed
A governance proposal passes; proposal calls transferOwnership
How it was found
- A proposal that calls governor.transferOwnership() is executed, transferring ownership to a new treasury address.
- When later proposals are passed, Governor.sol makes an external call to settings.treasury, which was not updated.
- As a result, settings.treasury cannot modify governance parameters such as proposalThreshold.
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 this system, a treasury contract controls important settings for governance and auctions. The treasury can transfer ownership of those contracts to a new address, but the system still remembers the old treasury address. This means future actions go to the wrong place, so governance can no longer change its rules and money from auctions may be lost.
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.