Missing duplicate veto check
The veto function in GovernorAlpha does not check if a proposal has already been vetoed, allowing the council to veto the same proposal multiple times. This could lead to repeated veto actions, potentially causing unintended state changes such as multiple queue calls.
Submitted by defsec
Impact
On the GovernorAlpha contract, function veto has been added. Although the function behaviour is expected, duplicate veto process has not been checked on that function.
Proof of Concept
- Navigate to following contract line. (https://github.com/code-423n4/2021-11-vader/blob/607d2b9e253d59c782e921bfc2951184d3f65825/contracts/governance/GovernorAlpha.sol#L562)
function veto(uint256 proposalId, bool support) external onlyCouncil {
ProposalState _state = state(proposalId);
require(
_state == ProposalState.Active || _state == ProposalState.Pending,
"GovernorAlpha::veto: Proposal can only be vetoed when active"
);
Proposal storage proposal = proposals[proposalId];
address[] memory _targets = proposal.targets;
for (uint256 i = 0; i < _targets.length; i++) {
if (_targets[i] == address(this)) {
revert(
"GovernorAlpha::veto: council cannot veto on proposal having action with address(this) as target"
);
}
}
VetoStatus storage _vetoStatus = proposal.vetoStatus;
_vetoStatus.hasBeenVetoed = true;
_vetoStatus.support = support;
if (support) {
queue(proposalId);
}
emit ProposalVetoed(proposalId, support);
}
/**
- The veto progress can be completed per proposal twice.
Tools Used
None
Recommended Mitigation Steps
Consider to check if proposals vetoed before.
VetoStatus storage _vetoStatus = proposal.vetoStatus;
require(!_vetoStatus.hasBeenVetoed, "Vetoed before");
Duplicate of #61
Not a duplicate
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 veto function lacks a check to ensure the proposal has not already been vetoed.
Impact
The council could veto the same proposal multiple times, potentially causing repeated queue calls and unintended state changes.
What the attacker needed
Caller must be council member; proposal must be active or pending
The fix
Add a check to ensure the proposal has not been vetoed before.
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 a smart contract, a veto lets a privileged group cancel a proposal. The code forgot to check if a proposal was already vetoed, so the same proposal could be vetoed again and again. This might cause problems like queuing the proposal multiple times.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.