Core Contracts

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

Emergency withdrawals can not be stopped

Summary

Emergency withdrawals can not be stopped

Vulnerability Details

Emergency withdrawals can be activated with the code below:

function enableEmergencyWithdraw() external onlyOwner withEmergencyDelay(EMERGENCY_WITHDRAW_ACTION) {
emergencyWithdrawDelay = block.timestamp + EMERGENCY_DELAY;
emit EmergencyWithdrawEnabled(emergencyWithdrawDelay);
}

Then, emergencyWithdraw() can be called with the following condition:

if (emergencyWithdrawDelay == 0 || block.timestamp < emergencyWithdrawDelay) revert EmergencyWithdrawNotEnabled();

The emergency withdraw delay must be set and we must be after that timestamp for the function to work. The issue is that emergencyWithdrawDelay can never be removed which means that once the delay passes, emergency withdrawals (which allow withdrawing before the lock's end) will always be possible.

Impact

Withdrawals will be always possible immediately once the delay has been set, no way to remove it.

Tools Used

Manual Review

Recommendations

Implement a function to set the value to 0

Updates

Lead Judging Commences

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

veRAACToken::emergencyWithdraw permanently enables lock-bypassing after activation with no way to disable it, permanently breaking token time-locking functionality

Support

FAQs

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

Give us feedback!