https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/governance/proposals/Governance.sol
https://github.com/Cyfrin/2025-02-raac/blob/main/contracts/core/tokens/veRAACToken.sol
The Governance
contract is vulnerable to a quorum bypass attack when the emergency withdraw feature is enabled in the veRAACToken
contract. An attacker can repeatedly lock and withdraw RAAC tokens to create multiple voting accounts, allowing them to accumulate voting power and bypass the quorum requirement for a proposal. This vulnerability arises because the emergency withdraw feature allows users to withdraw their locked tokens and reuse them to create new voting positions.
The Governance
contract relies on voting power derived from locked RAAC tokens in the veRAACToken
contract to determine whether a proposal meets the quorum requirement. However, when the emergency withdraw feature is enabled, users can withdraw their locked tokens and reuse them to create new voting positions.
The root cause of this vulnerability lies in the combination of two factors:
Emergency Withdraw Feature: The veRAACToken
contract allows users to withdraw their locked tokens when emergency withdraw is enabled. This feature is intended for emergencies but can be exploited to manipulate voting power.
Reusability of Tokens: After withdrawing their tokens, users can transfer them to new accounts and lock them again to create new voting positions. This allows the same tokens to be used multiple times to accumulate voting power.
The Governance
contract does not have any mechanism to detect or prevent this behavior, making it possible for an attacker to bypass the quorum requirement.
Scenario Example
Proposal Creation: A proposal is created, and the voting period begins.
Emergency Withdraw: The attacker enables emergency withdraw and withdraws their locked RAAC tokens.
Token Reuse: The attacker transfers the withdrawn tokens to multiple new accounts and locks them to create new voting positions.
Quorum Bypass: The attacker uses the new voting positions to vote on the proposal, bypassing the quorum requirement.
The vulnerability is demonstrated in the following Foundry test suite. Convert to foundry project using the steps highlighted here. Then in the test/
folder create a Test file named GovernanceTest.t.sol
and paste the test into it. Make sure the imports path are correct and run the test using forge test --mt testBypassProposalExecutionQuorum
:
Quorum Bypass: An attacker can bypass the quorum requirement for a proposal by creating multiple voting positions using the same tokens.
Governance Manipulation: The attacker can manipulate the governance process to pass proposals that would otherwise not meet the quorum requirement which can disrupt the protocol's functionality.
Foundry: Used to write and execute the test suite that demonstrates the vulnerability.
Manual Review
Disable Locking During Emergency Withdraw:
Disable the ability to lock tokens in the veRAACToken
contract when emergency withdraw is enabled. This prevents users from creating new voting positions during an emergency.
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.