-
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
Delegatees can keep delegator's deposits against their will using frontrunning #369
Comments
141345 marked the issue as duplicate of #116 |
141345 marked the issue as duplicate of #82 |
alcueca changed the severity to 3 (High Risk) |
alcueca changed the severity to 2 (Med Risk) |
alcueca marked the issue as partial-50 |
141345 marked the issue as not a duplicate |
141345 marked the issue as duplicate of #375 |
alcueca marked the issue as partial-50 |
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
Impact
A voter cannot redelegate his deposit except the new
delegatee
has a higher lock time than the current delegatee.This is a good design choice for the benefit of the protocol. But for a user that wants to redelegate, undelegate he may be prevented by the current delegatee.
The current delegatee can achieve this by frontrunning any transaction that wants to redelegate an amount currently delegated to him. The frontrun transaction will increase his lock time, which will make the incoming transaction invalid. Although this can be avoided if the transaction is sent through a private RPC URL or if the new delegate's lock time can be increased and the delegation happens in the same block.
Depending on the technical level of the voter, this might be feasible to perform.
Ultimately, the lock time of the new delegatee has to be increased to redelegate or undelegate which may not be favorable for him.
Proof of Concept
Tools Used
Vscode
Recommended Mitigation Steps
The current check seems more like a design choice to make sure voters remain in the contract longer than their lock time. Replacing it with the check below will help achieve the same objective with no detriment to the voter.
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: