Closed sherlock-admin2 closed 11 months ago
Invalid, this is speculating on wrong input utilization of the getTWAPRatio
. Additionally, zero address checks are not valid based on sherlock rules.
- Zero address checks: Check to make sure input values are not zero addresses.
Irissme
high
UniswapV3OracleHelper Contract: Lack of Token Address Validation in getTWAPRatio Function in Oracle.sol
Summary
The UniswapV3OracleHelper contract lacks proper verification of token addresses in the getTWAPRatio function. Failure to validate token addresses may pose a security risk if incorrect or malicious addresses are passed to the function.
Vulnerability Detail
The vulnerability lies in the getTWAPRatio function of the UniswapV3OracleHelper contract, where there is a lack of validation for the correctness of the token addresses token0 and token1.
Impact
If incorrect or malicious token addresses are provided to the getTWAPRatio function, it may lead to unpredictable behavior or potential security vulnerabilities, compromising the reliability and security of the UniswapV3OracleHelper contract.
Code Snippet
https://github.com/sherlock-audit/2023-11-olympus/blob/main/bophades/src/libraries/UniswapV3/Oracle.sol#L140-L158 Oracle.sol
Tool used
Manual Review
Recommendation
It is recommended to implement proper validation checks for the correctness of the provided token addresses within the getTWAPRatio function. The validation can include checks for valid Ethereum addresses and whether the addresses correspond to ERC20 tokens.
Here's an example of how the validation checks can be implemented: