Shortfall might be calculated incorrectly if a price value for one collateral isn't fetched correctly #200
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-20
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Lines of code
https://github.com/reserve-protocol/protocol/blob/df7ecadc2bae74244ace5e8b39e94bc992903158/contracts/p1/mixins/RecollateralizationLib.sol#L449
Vulnerability details
Impact
Function
price()
of an asset doesn't revert. It returns values(0, FIX_MAX)
forlow, high
values of price in case there's a problem with fetching it. Code that callsprice()
is able to validate returned values to detect that returned price is incorrect.Inside function
collateralShortfall()
ofRecollateralizationLibP1
collateral price isn't checked for correctness. As a result incorrect value ofshortfall
might be calculated if there are difficulties to fetch a price for one of the collaterals.Proof of Concept
Recommended Mitigation Steps
Check that price is correctly fetched for a collateral.
The text was updated successfully, but these errors were encountered: