The _executeProposal
function in the Governance
contract lacks a check to ensure a proposal hasn't already been executed. This allows for a proposal to be executed multiple times, potentially leading to unintended consequences and state corruption.
The _executeProposal
function in contracts/core/governance/proposals/Governance.sol is responsible for executing a proposal after it has been successfully voted on and the timelock delay has passed. The function retrieves the ProposalCore
struct and calls the _timelock.executeBatch
function. After the timelock execution, the proposal.executed
flag is set to true
. However, there is no check performed at the beginning of the function to verify that proposal.executed
is false
before proceeding with the execution.
If a proposal can be re-executed, the impact depends on the nature of the proposal itself. For example, if a proposal involves transferring tokens or updating a critical system parameter, executing it multiple times could lead to:
Draining of funds from a contract.
Incorrect system state, potentially breaking core functionality.
Unexpected behavior and security vulnerabilities.
Manual code review.
Add a check at the beginning of the _executeProposal
function to ensure that the proposal has not already been executed. This can be done by checking the proposal.executed
flag. If the flag is already set to true
, the function should revert with an appropriate error message.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.