The executeEmergencyAction function in the TimelockController contract allows privileged users with the EMERGENCY_ROLE to execute emergency actions immediately after scheduling them, without enforcing the intended EMERGENCY_DELAY (1 day). The lack of a delay check undermines the security assumptions of the timelock mechanism, potentially allowing malicious or erroneous emergency actions to be executed instantly.
The TimelockController contract defines a constant delay:
However, in the executeEmergencyAction function, there is no verification to ensure that this delay has elapsed after scheduling .
The scheduleEmergencyAction function merely sets a boolean flag without recording the timestamp.
Since executeEmergencyAction only checks the boolean _emergencyActions[id] and deletes it without any time check, an actor with EMERGENCY_ROLE can schedule and immediately execute an emergency action in a single transaction.
Malicious actions such as fund transfers, protocol upgrades, or governance takeovers can be executed immediately by a compromised EMERGENCY_ROLE holder.
Manual Review
** Enforce EMERGENCY_DELAY:**
Store the scheduling timestamp instead of a boolean in _emergencyActions.
2. Update scheduleEmergencyAction to record the timestamp:
3. Add a delay check in executeEmergencyAction:
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.