-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unfair changes to cooldown period affect existing withdrawals #607
Comments
alcueca marked the issue as primary issue |
@jatinj615, please review |
Expected behaviour. as AVS slashing can enforce a longer cooldown. and protocol want the ability to price the existing withdrawals for slashing at time of claim. |
Usually, giving the protocol the option to change terms and conditions without giving users an option to bail out is considered a Medium. To avoid excessive reporting of issues that would invariably be found as expected behaviour by sponsors, I'm going to recommend the sponsor to clearly include in the terms and conditions that that cooldown period can be changed by governance, affecting withdrawals in the queue. |
alcueca marked the issue as unsatisfactory: |
alcueca changed the severity to QA (Quality Assurance) |
alcueca marked the issue as grade-b |
Lines of code
https://github.com/code-423n4/2024-04-renzo/blob/main/contracts/Withdraw/WithdrawQueue.sol#L287
Vulnerability details
To prevent users from immediately claiming their withdrawals, the
WithdrawQueue
enforces a cooldown period during which the funds cannot be claimed. This cooldown period is stored in thecoolDownPeriod
variable and can be modified by the admin via theupdateCoolDownPeriod()
function.The issue is that when a user goes to claim their withdrawal by calling
claim()
, the current value ofcoolDownPeriod
is used to check if enough time has elapsed since the withdrawal was initiated:This means that if the cooldown period is increased after a user initiates a withdrawal, they will have to wait longer than expected to claim their funds. This is unfair as the terms of the withdrawal should be honored as they were when the user initiated it. Conversely, if the cooldown period is decreased, users can claim their withdrawals sooner than was originally enforced when they initiated the withdrawal.
Impact
Changes to the cooldown period will unexpectedly affect existing user withdrawals.
Proof of Concept
withdraw()
when thecoolDownPeriod
is set to 7 daysupdateCoolDownPeriod()
to change thecoolDownPeriod
to 30 daysclaim()
their withdrawal, the transaction reverts withEarlyClaim
Tools Used
Manual review
Recommended Mitigation Steps
Instead of storing the timestamp at which the request was created as
WithdrawRequest.createdAt
, store the timestamp at which it can be claimed by adding the current cooldown period toblock.timestamp
on creation and storing it as e.g.unlockTime
.Assessed type
Other
The text was updated successfully, but these errors were encountered: