Cyfrin / 2023-07-foundry-defi-stablecoin

38 stars 33 forks source link

Improper staleness validation #1101

Open codehawks-bot opened 1 year ago

codehawks-bot commented 1 year ago

Improper staleness validation

Severity

Medium Risk

Summary

There is an improper staleness validation.

Vulnerability Details

There is a staleness check into the OracleLib library. However, it is improper, because different Chainlink price feeds have different update frequency. Therefore, it will be improperly validated for different feeds.

Impact

It will cause revert when it is not needed and no revert when it is needed.

Tools Used

Manually

Recommendations

Use a mapping with different timeouts for different feeds.