Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: low
Valid

Emergency Actions Bypass Timelock Protection in `TimelockController`

Summary

The TimelockController contract defines an EMERGENCY_DELAY constant of 1 day but fails to enforce this delay in its emergency action execution logic. This allows emergency actions to be executed immediately after scheduling, effectively bypassing the timelock protection mechanism.

Vulnerability Details

The TimelockController implements two distinct operation paths:

  1. Regular operations (through scheduleBatch and executeBatch)

  2. Emergency operations (through scheduleEmergencyAction and executeEmergencyAction)

While regular operations properly enforce a minimum delay of 2 days (MIN_DELAY), the emergency operations path contains a critical flaw:

The _emergencyActions mapping does not track when the emergency action was scheduled; it only stores a boolean flag. There's no timestamp associated with the emergency action:

function scheduleEmergencyAction(bytes32 id) external onlyRole(EMERGENCY_ROLE) {
_emergencyActions[id] = true;
emit EmergencyActionScheduled(id, block.timestamp);
}

executeEmergencyAction only checks if the action is scheduled but doesn't enforce any delay:

function executeEmergencyAction(
address[] calldata targets,
uint256[] calldata values,
bytes[] calldata calldatas,
bytes32 predecessor,
bytes32 salt
) external payable onlyRole(EMERGENCY_ROLE) nonReentrant {
bytes32 id = hashOperationBatch(targets, values, calldatas, predecessor, salt);
if (!_emergencyActions[id]) revert EmergencyActionNotScheduled(id);
delete _emergencyActions[id];
// ... execution logic ...
}

The EMERGENCY_DELAY constant (1 day) exists but is completely unused:

/// @notice Delay for emergency actions (1 day)
uint256 public constant EMERGENCY_DELAY = 1 days;

This vulnerability effectively nullifies the timelock protection for emergency actions, despite the contract clearly intending to have a 1-day delay as evidenced by the EMERGENCY_DELAY constant.

Impact

Emergency actions can be executed instantly after scheduling, defeating the primary purpose of a timelock controller.

Tools Used

Manual Review

Recommendations

The EMERGENCY_DELAY should be enforced by requiring that block.timestamp >= scheduledTimestamp + EMERGENCY_DELAY before execution.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

TimelockController emergency actions bypass timelock by not enforcing EMERGENCY_DELAY, allowing immediate execution

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

TimelockController emergency actions bypass timelock by not enforcing EMERGENCY_DELAY, allowing immediate execution

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!