Closed sherlock-admin2 closed 11 months ago
Invalid, insufficient proof that read-only reentrancy is possible. This issue is simply stating it is possible but doesn't really explain how it is possible, so it would constitute this sherlock rule.
- In case of non-obvious issues with complex vulnerabilities/attack paths, Watson must submit a valid POC for the issue to be considered valid and rewarded.
Irissme
high
Critical Re-entry Vulnerability in UniswapV3OracleHelper's getTimeWeightedTick Function in Oracle.sol
Summary
The function getTimeWeightedTick in the UniswapV3OracleHelper library lacks proper safeguards against re-entry attacks. The absence of such protections may expose the contract to potential vulnerabilities associated with re-entry attacks.
Vulnerability Detail
The vulnerability arises from the fact that the function attempts to fetch data from pool.observe without implementing measures to guard against re-entry attacks. Re-entry attacks occur when a function can be called again before completing its initial execution, potentially leading to unintended and adverse effects on the contract's behavior.
Impact
This vulnerability could be exploited to execute the getTimeWeightedTick function multiple times concurrently, leading to unexpected behavior and potential security risks. Re-entry attacks might result in the manipulation of state variables or the execution of unintended logic, compromising the integrity and security of the contract.
Code Snippet
Oracle.sol https://github.com/sherlock-audit/2023-11-olympus/blob/main/bophades/src/libraries/UniswapV3/Oracle.sol#L67-L92
Tool used
Manual Review
Recommendation
To enhance the security of the getTimeWeightedTick function and mitigate the risk of re-entry attacks, it is recommended to implement the nonReentrant modifier. Below is an example of how you can modify the function to incorporate this safeguard