There is a critical flaw in governance.sol
that allows an attacker to drain ETH from the TimelockController.sol
contract through malicious proposals. With insufficient validation of proposal targets and values, combined with the ability to execute direct ETH transfers through empty calldata.
The POC demonstrates how an attacker with sufficient voting power (500k RAAC tokens) can:
Create a proposal to transfer all ETH (10 ETH in POC) from Timelock to themselves
Pass the proposal using their voting power
Execute through the timelock delay to drain funds
Successfully transfer protocol's ETH to their address
Under normal conditions, the governance system should have strict validation on:
Proposal targets (whitelist/blacklist)
Value transfers (limits/caps)
Empty calldata with value transfers
Treasury protection mechanisms
In Ethereum, a transaction can transfer ETH from one address to another without requiring any additional data in the calldata field. Calldata is typically used to specify function calls or pass parameters to smart contracts, but for a simple ETH transfer to an externally owned account (EOA), no calldata is needed. The transaction simply includes the sender’s address, the recipient’s address, the amount of ETH to transfer (in wei). The calldata would remain empty and the transfer will still execute successfully as long as the transaction is valid and has sufficient gas.
In Governance.sol:
The propose
function: https://github.com/Cyfrin/2025-02-raac/blob/89ccb062e2b175374d40d824263a4c0b601bcb7f/contracts/core/governance/proposals/Governance.sol#L127
propose()
function fails to validate the ProposalType parameter.
Looking at the fucntion more closely:
This opens the fucntion to series of attacks.
Proof of code: add this code to the test file and run the code:
Initial Setup - Attacker Gets Voting Power:
Create Malicious Proposal:
Direct Financial Loss:
Immediate: Loss of all ETH in Timelock (10 ETH in POC)
Future: Protocol treasury at risk
Scale: Could affect all protocol ETH holdings
Protocol Operations:
Treasury management disrupted
ETH-based operations blocked
Add Target Validation
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.