This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
0x52 - Pending CRV rewards are not accounted for and can cause unfair liquidations #136
Labels
High
A valid High severity issue
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
0x52
high
Pending CRV rewards are not accounted for and can cause unfair liquidations
Summary
pendingRewards are factored into the health of a position so that the position collateral is fairly assessed. However WCurveGauge#pendingRewards doesn't return the proper reward tokens/amounts meaning that positions aren't valued correctly and users can be unfairly liquidated.
Vulnerability Detail
BlueBerryBank.sol#L408-L413
When BlueBerryBank is valuing a position it also values the pending rewards since they also have value.
WCurveGauge.sol#L106-L114
Above we see that WCurveGauge#pendingRewards returns empty arrays when called. This means that pending rewards are not factored in correctly and users can be liquidated when even when they should be safe.
Impact
User is liquidated when they shouldn't be
Code Snippet
WCurveGauge.sol#L106-L114
Tool used
Manual Review
Recommendation
Change WCurveGauge#pendingRewards to correctly return the pending rewards
The text was updated successfully, but these errors were encountered: