getPriceFromChainlink function might return stale results
Summary
In the PriceOracle contract, you are using Chainlink’s latestRoundData API, but there are missing checks, for example, updatedAt property is not extracted and validated.
Vulnerability Detail
Missing multiple validation checks, only price > 0 was performed which is totally insufficient.
Impact
For instance not checking how stale the answer is could lead to stale prices according to the Chainlink documentation and even to entirely drained protocols.
martin
medium
getPriceFromChainlink
function might return stale resultsSummary
In the
PriceOracle
contract, you are using Chainlink’s latestRoundData API, but there are missing checks, for example,updatedAt
property is not extracted and validated.Vulnerability Detail
Missing multiple validation checks, only
price > 0
was performed which is totally insufficient.Impact
For instance not checking how stale the answer is could lead to stale prices according to the Chainlink documentation and even to entirely drained protocols.
Code Snippet
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/oracle/PriceOracle.sol#L66
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/oracle/PriceOracle.sol#L107
Tool used
Manual Review
Recommendation
Consider adding the missing checks:
Duplicate of #9