Honest users could be permanently DOS'd from withdrawing their vested tokens/rewards #181
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
M-20
primary issue
Highest quality submission among a set of duplicates
🤖_primary
AI based primary recommendation
🤖_08_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-07-loopfi/blob/57871f64bdea450c1f04c9a53dc1a78223719164/src/reward/ChefIncentivesController.sol#L518
Vulnerability details
Proof of Concept
ChefIncentivesController#Claim() is a public function and callable by anyone.
When claiming there is a need to vest the tokens, now this vesting directly vests to the multifeedistributor, in the
In MultiFeeDistribution#vestTokens(), there is a logic to only allow pushing a new entry for a user to his
_userEarnings
array once in a day.These rewards are then kept, and then after the vesting period a user can claim their rewards, where the
_userEarnings
array would be looped through.Now from the links to the necessary functions attached, we can see that there is no minimum claimants to be made, asides the check that
RDNT
must be >0
, however as little as1
is allowed.So for active users that could earn even if little rewards per day, this then allows a malicious user to cause a permanent DOS to claiming their vested tokens, since all the attacker has to do, is once a day for as long as the vesting duration query, which could in valid scenarios be quite lengthy query ChefIncentivesController#Claim() while passing the user's address and then when the user comes to withdraw their vested tokens, the loop OOG's and then reverts due to the amount of entries in the
_userEarnings
array .Impact
Potential permanent DOS to honest users [(or force the users to incur losses since some tech savvy users can notice this griefing attempt, but to stop this they'd have to withdraw early which forces them to incur losses)(https://github.com/code-423n4/2024-07-loopfi/blob/57871f64bdea450c1f04c9a53dc1a78223719164/src/reward/MultiFeeDistribution.sol#L505-L525)], since even if the vesting duration reduces there is no other method for the user to withdraw their tokens and it's stuck in the protocol, alternatively if the user leaves the claiming of their tokens even after the vesting period and does not immediately withdraw, the chances of this happening heavily increases since with each day an entry to the
_userEarnings
array can be made.Recommended Mitigation Steps
Consider introducing some access control to ChefIncentivesController#Claim() and only allow the users call this for themselves.
Assessed type
DoS
The text was updated successfully, but these errors were encountered: