From the Chainlink docs we can verify that the use of latestAnswer() is deprecated and should not be used.
The impact is that the latestAnswer can return 0 and cause the variables baseAnswerNomalized and quoteAnswerNormalized to be set as 0.
Proof of Concept
The NatSpec of latestAnswer is the following
@dev #[deprecated] Use latestRoundData instead. This does not error if no answer has been reached, it will simply return 0. Either wait to point to an already answered Aggregator or use the recommended latestRoundData instead which includes better verification information.
Tools Used
Manual Review, Solodit
Recommended Mitigation Steps
Use the latestRoundData function to get the price instead.
Lines of code
https://github.com/code-423n4/2024-03-abracadabra-money/blob/main/src/oracles/aggregators/MagicLpAggregator.sol#L38-L39
Vulnerability details
Impact
The function
MagicLpAggregator::latestAnswer()
contains the following lines of codeFrom the Chainlink docs we can verify that the use of
latestAnswer()
is deprecated and should not be used.The impact is that the
latestAnswer
can return 0 and cause the variablesbaseAnswerNomalized
andquoteAnswerNormalized
to be set as 0.Proof of Concept
The NatSpec of
latestAnswer
is the followingTools Used
Manual Review, Solodit
Recommended Mitigation Steps
Use the latestRoundData function to get the price instead.
Assessed type
Oracle