The TimelockController
contract contains a critical vulnerability in its executeBatch
function where processing a large number of targets in a single transaction may exceed Ethereum's block gas limit. This results in transaction failures, rendering governance proposals unexecutable and enabling denial-of-service (DoS) attacks against protocol operations.
Function: executeBatch(address[],uint256[],bytes[],bytes32,bytes32)
Code Snippet:
The loop iterates over all targets and executes external calls without considering gas limitations. Each iteration consumes gas for:
Accessing array elements (targets[i]
, values[i]
, calldatas[i]
),
Performing a low-level call
operation,
Checking success status.
Gas Cost Breakdown:
Base loop overhead: ~500 gas per iteration (increment i
, condition checks),
Low-level call
: ~2,100 gas (minimum for empty call),
Revert handling: ~20,000 gas (if calls fail),
Total per iteration: ~20,000 - 30,000 gas (conservative estimate for simple calls).
With Ethereum's block gas limit at ~30 million gas, a batch of 1,000 targets would require:
This exceeds the block limit, causing transaction reversion.
Failed Governance Actions: Legitimate proposals with large target sets become permanently stuck.
DoS Attack Vector: Malicious proposers can intentionally create unexecutable operations.
Protocol Paralysis: Critical updates (security patches, parameter changes) may be blocked.
Manual Code Analysis: Identified gas-intensive loop structure.
Gas Estimation: Used Remix IDE and Hardhat for gas profiling.
Ethereum Block Explorer: Verified current block gas limits (30M gas).
User create Proposer:
A proposer schedules a batch with 1,500 targets using scheduleBatch
.
Each target calls a minimal contract (e.g., empty fallback
function).
Execution Attempt:
After the timelock delay, an executor calls executeBatch
.
Transaction consumes all available gas and reverts.
Deploy Test Contract:
Create Malicious Batch:
Advance Time:
Execute Batch:
Transaction reverts with out of gas
error.
Batch remains in pending state indefinitely.
Add Target Limit:
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.