30926 - [SC - Low] AlchemixGovernor updates to quorum can affect p...
Submitted on May 8th 2024 at 13:10:54 UTC by @Lastc0de for Boost | Alchemix
Report ID: #30926
Report type: Smart Contract
Report severity: Low
Target: https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/AlchemixGovernor.sol
Impacts:
Manipulation of governance voting result deviating from voted outcome and resulting in a direct change from intended effect of original results
Description
Brief/Intro
In governance, there are usually proposals that for some reason (such as lack of quorum, and the number of votes ) defetated. This issue concerns instances of Governor that use the module GovernorVotesQuorumFraction
In your protocol it is known as L2GovernorVotesQuorumFraction :
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/governance/L2GovernorVotesQuorumFraction.sol
GovernorVotesQuorumFraction: Combines with GovernorVotes to set the quorum as a fraction of the total token supply. AlchemixGovernor inherits this module
So this make vulnerable AlchemixGovernor contract.
If this report is unclear to you, refer to the reference link
Vulnerability Details
Vulnerable contract is AlchemixGovernor.sol
&& L2GovernorVotesQuorumFraction.sol
https://github.com/alchemix-finance/alchemix-v2-dao/blob/main/src/governance/L2GovernorVotesQuorumFraction.sol
Vulnerable function is quorum()
:
https://github.com/alchemix-finance/alchemix-v2-dao/blob/f1007439ad3a32e412468c4c42f62f676822dc1f/src/governance/L2GovernorVotesQuorumFraction.sol#L49C1-L51C6
The token.getPastTotalSupply(blockNumber)
call will not be optimized the same way and, A mechanism that determines quorum requirements as a percentage of the voting token's total supply. when a proposal is passed to lower the quorum requirement, past proposals may become executable if they had been defeated only due to lack of quorum, and the number of votes it received meets the new quorum requirement.
Impact Details
Past proposals may become executable if they had been defeated only due to lack of quorum, and the number of votes it received meets the new quorum requirement.
References
https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-xrc4-737v-9q75
https://docs.openzeppelin.com/contracts/4.x/api/governance
Proof of Concept
To manually prank the executer and call a function with
onlyGovernance
modifier we need add calldata to queue:
1- Add the following function ro L2Governor.sol
file
2- Add following function to AlchemixGovernor.t.sol
file
3- Run test
Last updated