The _getData and _getOracleData functions are responsible for retrieving and processing data from oracles. However, neither function validates whether the returned data is greater than zero. This lack of validation introduces critical vulnerabilities, including division by zero errors and propagation of invalid data, which can destabilize the contract and lead to incorrect operations.
The _getData function retrieves data from multiple oracles and processes it sequentially. However, it does not ensure that the data returned by any oracle is greater than zero.
When the invert flag is true, the function attempts to calculate 10 ** 36 / data, which results in a division by zero if data is zero. This causes the contract to revert.
The _getOracleData function retrieves data from an individual oracle but does not validate that the returned data is greater than zero before assigning it to the OracleData struct.
Invalid or zero data could bypass validation and be used in subsequent calculations or operations, leading to undesired outcomes.
Zero or negative values can lead to incorrect calculations and inconsistent results, potentially impacting users and the system’s reliability. Faulty operations due to invalid data could result in significant financial losses for users and stakeholders.
Manual Review
Introduce a validation step to ensure that all data returned from oracles is greater than zero before use.
_getData function
_getOracleData function
Multihop will call ChainlinkOracle and the check is in it: `require(data > 0, "INVLDDATA");` MultiHop is just here to combine Chainlinks feed when there is no direct USD price feed for a token.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.