Core Contracts

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

Emergency withdrawals stay enabled forever

Summary

Once emergency withdrawals get enabled they cannot get disabled, which gives users the opportunity to withdraw before the lock period has ended.

Vulnerability Details

In the veRAACToken contract, the owner can enable emergency withdrawals using the enableEmergencyWithdraw function. After the EMERGENCY_DELAY has passed anyone can call emergencyWithdraw which allows anyone to withdraw.

Current check allows permanent emergency withdrawal:

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

Impact

Critical: After an emergency, the veRAACToken contract will no longer be working as intended and anyone would be able to bypass the lock. Emergencies are possible in any protocol and the first emergency would completely break the functionality of the contract, which makes this a high severity issue.

Recommendations

The current emergency flow is:

OFF -> enableEmergencyWithdraw -> 3 day delay (EMERGENCY_DELAY) -> ON forever

The owner should be able to cancel the emergency by adding a function to switch it off or by introducing a limited window for emergency withdrawals:

OFF -> enableEmergencyWithdraw -> 3 day delay (EMERGENCY_DELAY) -> ON -> function to switch it OFF

OR

OFF -> enableEmergencyWithdraw -> 3 day delay (EMERGENCY_DELAY) -> ON for specific window -> OFF

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 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.