When Owner of Ondo Price Oracle contracts attempts to associate the custom fToken with an external cToken, it is possible to use the same address for both tokens. such that fTokenToCToken[fToken] is fToken address itself. There is no check to ensure fToken != cToken
This could lead to Oracle returning price of fToken instead of the cToken in the call to getUnderlyingPrice()
Lines of code
https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracle.sol#L92-L99 https://github.com/code-423n4/2023-01-ondo/blob/main/contracts/lending/OndoPriceOracleV2.sol#L194-L220
Vulnerability details
Impact
When Owner of Ondo Price Oracle contracts attempts to associate the custom fToken with an external cToken, it is possible to use the same address for both tokens. such that
fTokenToCToken[fToken]
is fToken address itself. There is no check to ensure fToken != cTokenThis could lead to Oracle returning price of fToken instead of the cToken in the call to getUnderlyingPrice()
Proof of Concept
fTokenToCToken[fToken]
will be contractATools Used
Manual
Recommended Mitigation Steps
Add an additional line in the functions to ensure fToken address is not equals to cToken address.