The veRAACToken contract's emergency withdrawal mechanism remains active even after the emergency action is cancelled, allowing users to withdraw their locked tokens indefinitely. This breaks the core lock mechanism of the vote-escrow system.
Vulnerability Details:
The vulnerability exists in the interaction between enableEmergencyWithdraw()
and cancelEmergencyAction()
:
The issue arises because:
enableEmergencyWithdraw()
sets emergencyWithdrawDelay
cancelEmergencyAction()
only deletes the action from _emergencyTimelock
emergencyWithdrawDelay
is never reset
emergencyWithdraw()
only checks this delay:
Lock Mechanism Compromise: Users can permanently bypass token lock periods, this allow anyone to withdraw all their locked RAACTokens anytime they want so far the enableEmergencyWithdraw
has been called once. this breaks the whole lock mechanism of the veRAACtoken contract.
Vote-Escrow Model Breakdown:
veRAACToken's value proposition relies on users locking RAAC for extended periods
Longer locks = More voting power = Higher boost multipliers
With permanent emergency withdrawals:
Users can lock for maximum duration (4 years)
Get maximum voting power/boost
Withdraw immediately through emergency withdrawal
Effectively gaming the time-value mechanism
Emergency state cannot be effectively cancelled
Emergency state becomes permanent and no way to return to normal operations then, the protocol loses control over lock mechanism. This will damage protocol's credibility and may lead to mass withdrawals and protocol instability.
PoC:
Output of the test:
The test shows that a user can exploit the emergency withdrawal mechanism in the following sequence:
1. Initial Setup:
User has 1000 RAAC tokens minted to their address
User approves veRAACToken contract to spend their RAAC
2. Lock Operation:
User locks 1000 RAAC tokens for 1 year (365 days)
His RAAC balance decreases by 1000 tokens
He received veRAACToken representing his voting power
3. Emergency Process:
Owner schedules emergency withdrawal action the next day of the lock
System waits for first emergency delay (3 days)
Owner enables emergency withdrawal
System waits for second emergency delay (3 days)
4. Critical Exploit:
Owner cancels the emergency action immediately
User was still able to execute emergency withdrawal
User successfully withdraws his 1000 RAAC tokens
His balance returns to initial amount
User locked 1000 RAAC tokens again and then withdraw it immediately using the emergencyWithdraw function.
5. Verification:
Test confirms user's RAAC balance is restored
Importantly, emergencyWithdrawDelay
remains greater than 0
This means emergency withdrawal stays permanently enabled
The test demonstrates that cancelling the emergency action fails to disable the emergency withdrawal functionality, allowing users to bypass lock periods indefinitely.
Manual review
Add emergency state reset in cancellation:
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.