Usage of lastEligibleStatus
can cause user to miss out on rewards on manualStopEmissionsFor
invocation
#121
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
M-30
primary issue
Highest quality submission among a set of duplicates
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#L605-L608
Vulnerability details
Impact
Invoking
manualStopEmissionsFor
can cause the user to miss out on rewards from vaults even after the user becomes eligibleProof of Concept
If
lastEligibleStatus
andisCurrentlyEligible
returns true, only the balance of the specific vault is updated. The idea is that whenever both these are true, all the other balances would have already been updated to the current value and hence need not be re-queried againBut this assumption is broken when
manualStopEmissionsFor
is called which will set the balance corresponding to each vault as 0Hence in this case, if an user's vault position update makes the user eligible for rewards, only that specific vault associated debt will be earning rewards and all the other vault balances won't be updated
Tools Used
Manual review
Recommended Mitigation Steps
The
lastEligibleStatus
check can be removed or it can be handled alongside themanualStopEmissionsFor
implementationAssessed type
Other
The text was updated successfully, but these errors were encountered: