Cyfrin / 2023-07-foundry-defi-stablecoin

37 stars 32 forks source link

Possible break of the whole protocol #1109

Open codehawks-bot opened 1 year ago

codehawks-bot commented 1 year ago

Possible break of the whole protocol

Severity

Medium Risk

Summary

getUsdValue() could return fully improper values.

Vulnerability Details

getUsdValue() which is used to calculate the collateral value considers that there are only Chainlink price feeds with 8 decimals for the returned value. However, it could differ, which will cause e.g. in case of 18 decimals much higher value of the collateral returned than expected and, therefore, much more stablecoins will be possible to mint.

Impact

Break of the whole protocol.

Tools Used

Manually

Recommendations

Get the decimals number from the price feed data.