-
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
Users delegating veCANTO may be forced into locking funds for more than the 5 years anticipated #116
Comments
141345 marked the issue as primary issue |
141345 marked the issue as duplicate of #82 |
141345 marked the issue as not a duplicate |
141345 marked the issue as duplicate of #178 |
141345 marked the issue as not a duplicate |
141345 marked the issue as duplicate of #82 |
alcueca changed the severity to 2 (Med Risk) |
alcueca marked the issue as satisfactory |
141345 marked the issue as not a duplicate |
141345 marked the issue as duplicate of #375 |
alcueca marked the issue as duplicate of #182 |
alcueca changed the severity to 3 (High Risk) |
Lines of code
https://github.com/code-423n4/2023-08-verwa/blob/a693b4db05b9e202816346a6f9cada94f28a2698/src/VotingEscrow.sol#L384
Vulnerability details
VotingEscrow has one check in place for avoiding vote manipulation: delegation can move funds only from a shorter to a longer-locking account, and this includes when the delegation is undone. This is the root cause of an issue that is below.
This presents the scenario of Alice locking her 1M CANTO in VotingEscrow, and delegating to Bob because she is not very into keeping an eye on the votings happening.
Bob, on the contrary, is likely to be an entity who uses VotingEscrow just for receiving delegations of many users and voting on their behalf.
Both of these motivations offer Bob a concrete incentive in keeping their lock as far in time as possible (i.e. keeping it at 5 years by increasing their funds by 1 wei per week), because:
When Bob acts this way (which, as said, seems the most reasonable way to act for Bob), Alice may:
Impact
To withdraw the funds, Alice has only one option:
Proof of Concept
The situation can be showed in the following Foundry test:
Tools Used
Code review, Foundry
Recommended Mitigation Steps
There is, unfortunately, no easy fix I can think of to this issue because simply removing the "Only delegate to longer lock" check, even only for un-delegating, can easily open the possibility for bypassing the desired vote power decay over time.
Maybe it could be worth considering a change in the design:
Doing so will make the voting power of each delegator decay according to the original (delegator's) lock, so funds can be withdrawn when the original lock expires without opening the possibility of voting manipulation.
Assessed type
Governance
The text was updated successfully, but these errors were encountered: