roundId and answeredInRound are also returned. "You can check answeredInRound against the current roundId. If answeredInRound is less than roundId, the answer is being carried over. If answeredInRound is equal to roundId, then the answer is fresh."
Impact
WIthout validating the round id, stale or invalid price can be used.
ctf_sec
medium
Lack of sufficient validation for chainlink price feed
Summary
Lack of sufficient validation for chainlink price feed
Vulnerability Detail
In the current implementation of the chainlink price feed integration:
the round id is not validated.
According to the chainlink documentation:
https://docs.chain.link/data-feeds/price-feeds/historical-data/
Impact
WIthout validating the round id, stale or invalid price can be used.
In the function getPrice
Code Snippet
https://github.com/sherlock-audit/2023-01-sentiment/blob/main/oracle/src/gmx/GLPOracle.sol#L48
https://github.com/sherlock-audit/2023-01-sentiment/blob/main/oracle/src/gmx/GLPOracle.sol#L49
Tool used
Manual Review
Recommendation
We recommend the protocol validate the round id
Duplicate of #31