Platform: Code4rena
Start Date: 07/08/2023
Pot Size: $36,500 USDC
Total HM: 11
Participants: 125
Period: 3 days
Judge: alcueca
Total Solo HM: 4
Id: 274
League: ETH
Rank: 56/125
Findings: 1
Award: $15.83
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: ADM
Also found by: 0xDING99YA, 3docSec, BenRai, Jorgect, Kow, MrPotatoMagic, QiuhaoLi, RandomUser, SpicyMeatball, Tendency, Topmark, Watermelon, Yanchuan, Yuki, bart1e, cducrest, kaden, lsaudit, nemveer, nonseodion
15.8333 USDC - $15.83
https://github.com/code-423n4/2023-08-verwa/blob/a693b4db05b9e202816346a6f9cada94f28a2698/src/VotingEscrow.sol#L384 https://github.com/code-423n4/2023-08-verwa/blob/a693b4db05b9e202816346a6f9cada94f28a2698/src/VotingEscrow.sol#L331 https://github.com/code-423n4/2023-08-verwa/blob/a693b4db05b9e202816346a6f9cada94f28a2698/src/VotingEscrow.sol#L288-L323 https://github.com/code-423n4/2023-08-verwa/blob/a693b4db05b9e202816346a6f9cada94f28a2698/src/VotingEscrow.sol#L268-L284
In VotingEscrow.sol
, users with locked CANTO may call the delegate
function to transfer their voting power to one other user with an existing lock, transfer from their existing delegatee to another, or transfer back to themselves. A restriction on this action is that the end time of the new delegatee's lock must exceed the end time of the previous delegatee's lock.
The issue is anyone can increase their lock's end time by LOCKTIME
(currently 5 years) with increaseAmount
(or createLock
for an expired and withdrawn lock) with as little as 1 CANTO (plus gas fees).
This means a malicious delegatee may call increaseAmount
multiple times, forcing the votes' owner to call increaseAmount
an equivalent number of times if they want to retrieve their delegated voting power. The end time on the owner's lock is forced upwards and they cannot withdraw their funds even if they were originally intending to undelegate for the purpose of withdrawal (since withdraw
requires the lock's delegatee to be the lock's owner).
The cost of this for the malicious delegatee depends on how much CANTO they have locked, or whether they can withdraw their lock (which DOES NOT return delegated votes) before griefing (after which they can call createLock
and increaseAmount
with trivial amounts).
Alternatively, the restriction ties the owner's lock time to their delegatee's since their lock's end time must be > their delegatee's lock end time, potentially resulting in the delegatee's unmalicious action to increase their personal lock amount forcing the owner to do so unintentionally.
The lock's owner is forced to increase their lock duration by griefing or by delegatee's actions on their personal lock, obstructing their ability to transfer voting power to another delegatee or withdrawing after their original lock duration is due and reducing control over their investment in CANTO governance.
Manual Review
Consider removing the mentioned require statement or modify it so that it depends on the owner's lock time as the owner of voting power should be able to freely transfer it regardless of the lock times of the delegatee.
Other
#0 - c4-pre-sort
2023-08-13T14:21:55Z
141345 marked the issue as duplicate of #116
#1 - c4-pre-sort
2023-08-13T14:33:48Z
141345 marked the issue as not a duplicate
#2 - c4-pre-sort
2023-08-13T14:34:01Z
141345 marked the issue as primary issue
#3 - 141345
2023-08-13T14:36:29Z
similar issue as https://github.com/code-423n4/2023-08-verwa-findings/issues/178, but this one focus on the delegatee's side, intentionally or unintentionally.
178 and this might better be grouped.
#4 - OpenCoreCH
2023-08-16T14:13:59Z
I think this, https://github.com/code-423n4/2023-08-verwa-findings/issues/112, and #178 are the same issue, just reported from a bit different perspectives.
#5 - c4-sponsor
2023-08-16T14:14:05Z
OpenCoreCH marked the issue as sponsor confirmed
#6 - alcueca
2023-08-24T07:15:29Z
Taking this angle as the primary, as it is the one that would be exploited.
#7 - c4-judge
2023-08-24T07:20:33Z
alcueca changed the severity to 3 (High Risk)
#8 - alcueca
2023-08-24T07:20:59Z
Cycling to High and back to Medium hoping to set all 45 duplicates as Medium in one go
#9 - alcueca
2023-08-24T07:21:52Z
Duplicates with coded proof will be satisfactory, without they will get 50% credit.
#10 - c4-judge
2023-08-24T07:22:14Z
alcueca marked the issue as satisfactory
#11 - c4-judge
2023-08-24T07:22:20Z
alcueca marked the issue as partial-50
#12 - c4-judge
2023-08-24T07:23:37Z
alcueca marked issue #411 as primary and marked this issue as a duplicate of 411
#13 - c4-pre-sort
2023-08-24T08:21:42Z
141345 marked the issue as not a duplicate
#14 - c4-pre-sort
2023-08-24T08:23:55Z
141345 marked the issue as duplicate of #375
#15 - c4-judge
2023-08-24T21:10:35Z
alcueca changed the severity to 2 (Med Risk)
#16 - c4-judge
2023-08-24T21:10:57Z
alcueca marked the issue as partial-50
#17 - c4-judge
2023-08-29T06:36:58Z
alcueca marked the issue as duplicate of #182
#18 - c4-judge
2023-08-29T06:37:36Z
alcueca changed the severity to 3 (High Risk)