-
Notifications
You must be signed in to change notification settings - Fork 7
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
A user's tokens could be locked for an extended duration beyond their intention and without their control #225
Comments
141345 marked the issue as primary issue |
extend lock by others |
141345 marked the issue as sufficient quality report |
0xCalibur (sponsor) acknowledged |
0xCalibur marked the issue as disagree with severity |
Should be a low |
Here the latest discussion on transaction delays. And I would consider it QA which is due to low likelihood and medium impact (temporary freeze of funds) |
thereksfour changed the severity to QA (Quality Assurance) |
Hi, I would like to argue that likelihood is medium and impact is high. For impact, temporary FoF is a very serious issue, on the low end of the High impact (imo). Consider for example that a user assumes their tokens will be available at the unlock period in order to pay off a loan, and because of the FoF they will now default. This is just one example of hundred of different very serious scenarios that would occur to a user that assumes funds will be available in the future. Considering all the arguments above, I believe the finding to be between M and H severity, rather than between L and M severity. |
Agreed, the lock duration is jumping, which may compromise user |
This previously downgraded issue has been upgraded by thereksfour |
thereksfour marked the issue as satisfactory |
thereksfour marked the issue as selected for report |
Lines of code
https://github.com/code-423n4/2024-03-abracadabra-money/blob/1f4693fdbf33e9ad28132643e2d6f7635834c6c6/src/staking/LockingMultiRewards.sol#L155
Vulnerability details
Description
The LockingMultiRewards allows anyone to stake MagicLP tokens in return for rewards.
LP tokens are sent with either functions below:
This will lead to
_createLock()
, which calculates thenextUnlockTime()
:Note that
nextEpoch()
would always return the next 1-week (or reward duration) slot.An issue arises because the user cannot specify the latest desired unlock time. This opens the path for the tokens to be locked for longer than expected, which may have significant impact for users if they need the funds. Consider the following case, where
x
is week number:7x + 7 + lockDuration
7x + 14
7x + 14 + lockDuration
This means user's funds are locked for an additional 7 days more than expected.
Note that delayed execution of a user's TX has always been considered in scope, certainly for Med severity impacts:
- https://solodit.xyz/issues/m-13-interactions-with-amms-do-not-use-deadlines-for-operations-code4rena-paraspace-paraspace-contest-git
- https://solodit.xyz/issues/m-04-lack-of-deadline-for-uniswap-amm-code4rena-asymmetry-finance-asymmetry-contest-git
- https://solodit.xyz/issues/m-03-missing-deadline-param-in-swapexactamountout-allowing-outdated-slippage-and-allow-pending-transaction-to-be-executed-unexpectedly-code4rena-pooltogether-pooltogether-git
Essentially the locking function lacks a
deadline
parameter similar to swapping functions, and the impact is temporary freeze of funds.Impact
A user's tokens could be locked for an extended duration beyond their intention and without their control.
Tools Used
Manual audit
Recommended Mitigation Steps
Consider adding a
latestUnlockTime
deadline parameter for the locking functions.Assessed type
Timing
The text was updated successfully, but these errors were encountered: