Core Contracts

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

An operation in `scheduleBatch` can be scheduled even if the predecessor has not been executed

Summary

The TimelockController::scheduleBatch contains a logical flaw in the predecessor check condition allowing operation to be scheduled even if the predecessor has not been executed. This can lead to incorrect execution order.

Vulnerability Details

The issue lies in scheduleBatch():

if (predecessor != bytes32(0)) {
if (!isOperationDone(predecessor) && !isOperationPending(predecessor)) {
revert PredecessorNotExecuted(predecessor);
}
}

This conditional check !isOperationDone(predecessor) && !isOperationPending(predecessor) will always evaluate to false because:

  • If the predecessor operation does not exist, both isOperationDone(predecessor) and isOperationPending(predecessor) will return false, making the condition true && true, which is true.

  • If the predecessor operation exists, either isOperationDone(predecessor) or isOperationPending(predecessor) will return true, making the condition false.

Impact

Operations may be executed out of order.

Tools Used

Manual review

Recommendations

  • Remove this additional check since operations can be scheduled regardless of previous operation's execution status

  • Update the condition to correctly check if the predecessor operation has not been executed as:

    if (predecessor != bytes32(0)) {
    if (!isOperationDone(predecessor)) {
    revert PredecessorNotExecuted(predecessor);
    }
    }
Updates

Lead Judging Commences

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

TimelockController::scheduleBatch checks if predecessor is pending OR executed rather than requiring execution as per comment, allowing scheduling before predecessor executes

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

TimelockController::scheduleBatch checks if predecessor is pending OR executed rather than requiring execution as per comment, allowing scheduling before predecessor executes

Support

FAQs

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