QA Report #247
Labels
bug
Something isn't working
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
ChainLink price data could be stale
Lines of code
https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/connext/helpers/ConnextPriceOracle.sol#L122-L137
Vulnerability details
Impact
At ConnextPriceOracle.sol,
getPriceFromChainlink()
function invokesaggregator.latestRoundData()
. However, there are no checks if the return value indicates stale or subzero data. This could lead to wrong prices.Proof of Concept
https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/connext/helpers/ConnextPriceOracle.sol#L122-L137
According to the Chainlink documentation:
“A timestamp with zero value means the round is not complete and should not be used.”
“if answeredInRound < roundId could indicate stale data.”
Another reference
See example of mitigation here: https://github.com/cryptexfinance/contracts/blob/master/contracts/oracles/ChainlinkOracle.sol#L58-L65
Tools Used
Manual review
Recommended Mitigation Steps
Adding missing the checks to validate the data is not stale
The text was updated successfully, but these errors were encountered: