sherlock-audit / 2023-05-ironbank-judging

2 stars 2 forks source link

simon135 - no check on timestamp for latestRoundData #478

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

simon135

medium

no check on timestamp for latestRoundData

Summary

no check on timestamp so the price can be stale and outdated

Vulnerability Detail

since their is no check if timestamp is stale,it an cause the price to be old.

Impact

old prices which would cause worst rate for supplying/borrowing

Code Snippet

     (, int256 price,,,) = registry.latestRoundData(base, quote);

https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/oracle/PriceOracle.sol#LL67C4-L67C69

Tool used

Manual Review

Recommendation

add a hearbeat/timestamp checker with last oracle round

Duplicate of #9