Platform: Code4rena
Start Date: 28/11/2022
Pot Size: $192,500 USDC
Total HM: 33
Participants: 106
Period: 11 days
Judge: LSDan
Total Solo HM: 15
Id: 186
League: ETH
Rank: 100/106
Findings: 1
Award: $18.31
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0x52, 0xNazgul, Franfran, IllIllI, Jeiwan, Lambda, RaymondFam, Rolezn, Trust, __141345__, codecustard, erictee, gzeon, hansfriese, imare, rbserver, rvierdiiev, seyni, skinz, ujamal_
18.3064 USDC - $18.31
Price can be old and can lead to wrong answer return value.
Oracle data feed is insufficiently validated. There is no check for stale price and round completeness. Price can be stale and can lead to wrong answer return value. Buy with a newer price on another platform, use oracle’s stale price for arbitrage.
Check for roundId and timestamp to validate data. Include in if loop if fallbackOracle is preferred solution for stale price. Alternatively, put extra require checks at the end of the function. price = uint256(source.latestRoundData();
require(answer != 0, Errors.ORACLE_PRICE_NOT_READY); require(answeredInRound >= roundID, "ChainLink: Stale price"); require(timestamp > 0, "ChainLink: Round not complete");
Refer to https://docs.chain.link/docs/price-feeds-api-reference/
#0 - c4-judge
2022-12-20T17:45:40Z
dmvt marked the issue as duplicate of #5
#1 - c4-judge
2023-01-09T16:39:07Z
dmvt marked the issue as partial-50
🌟 Selected for report: IllIllI
Also found by: 0x52, 0xNazgul, Franfran, IllIllI, Jeiwan, Lambda, RaymondFam, Rolezn, Trust, __141345__, codecustard, erictee, gzeon, hansfriese, imare, rbserver, rvierdiiev, seyni, skinz, ujamal_
18.3064 USDC - $18.31
According to Chainlink’s documentation, the latestAnswer function is deprecated. This function might suddenly stop working if Chainlink stops supporting deprecated APIs. And the old API can return stale data.
ParaSpaceOracle.sol#L128. UiIncentiveDataProvider.sol#L118, L179, L275, L342. UiPoolDataProvider.sol#L221, L232, L245.
Use the latestRoundData function to get the price instead. Add checks on the return data with proper revert messages if the price is stale or the round is incomplete. https://docs.chain.link/docs/price-feeds-api-reference/
#0 - JeffCX
2022-12-18T03:27:13Z
#1 - c4-judge
2022-12-20T17:45:54Z
dmvt marked the issue as duplicate of #5
#2 - c4-judge
2023-01-09T16:39:30Z
dmvt marked the issue as partial-50
#3 - c4-judge
2023-01-23T15:51:58Z
dmvt marked the issue as satisfactory