Open sherlock-admin opened 1 year ago
Since we are using a view function we are unable to use exchangeRateCurrent()
we have to use exchangeRateStored()
Escalate for 10 USDC
The sponsor confirms that. so the user could get liquidated even in case his position is still healthy. I believe the rules are clear on that He decided to not fix it but the risk still exists
Escalate for 10 USDC
The sponsor confirms that. so the user could get liquidated even in case his position is still healthy. I believe the rules are clear on that He decided to not fix it but the risk still exists
You've created a valid escalation for 10 USDC!
To remove the escalation from consideration: Delete your comment.
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
Can be a valid medium
Escalation accepted
Valid medium Although the difference in the interest accumulated here can be very low as it updates slowly, although this cannot be exactly quantified, the fact that a position can be liquidated based on outdated value makes it a valid medium.
Escalation accepted
Valid medium Although the difference in the interest accumulated here can be very low as it updates slowly, although this cannot be exactly quantified, the fact that a position can be liquidated based on outdated value makes it a valid medium.
This issue's escalations have been accepted!
Contestants' payouts and scores will be updated according to the changes made on this issue.
Sponsor has acknowledged this risk
Ch_301
high
getPositionRisk()
will return a wrong value of riskSummary
In order to interact with SPELL the users need to
lend()
some collateral which is known as Isolated Collateral and the SoftVault will deposit them into Compound protocol to generate some lending interest (to earn passive yield)Vulnerability Detail
to liquidate a position this function
isLiquidatable()
should returntrue
and it is subcall to
getPositionRisk()
as we can see the
cv
is a critical value in terms of the calculation ofrisk
thecv
is returned bygetIsolatedCollateralValue()
and it uses
exchangeRateStored()
to ask Compound (CToken.sol) for the exchange rate fromCToken
contractso the
getPositionRisk()
will return a wrong value of risk because the interest does not accrue for this positionImpact
the user (position) could get liquidated even if his position is still healthy
Code Snippet
https://github.com/compound-finance/compound-protocol/blob/master/contracts/CToken.sol#LL270C1-L286C6
Tool used
Manual Review
Recommendation
You shoud use
exchangeRateCurrent()
to Accrue interest first.