Closed c4-submissions closed 1 year ago
raymondfam marked the issue as low quality report
raymondfam marked the issue as duplicate of #119
MiloTruck marked the issue as not a duplicate
MiloTruck marked the issue as duplicate of #156
MiloTruck marked the issue as satisfactory
Lines of code
https://github.com/Uniswap/v3-periphery/blob/697c2474757ea89fec12a4e6db16a574fe259610/contracts/libraries/OracleLibrary.sol#L16-L41 https://github.com/Uniswap/v3-periphery/blob/697c2474757ea89fec12a4e6db16a574fe259610/contracts/libraries/OracleLibrary.sol#L74-L88 https://github.com/CamelotLabs/core/blob/b51753e816de02e591acb2c07dc9eed7a4179a68/contracts/CamelotPair.sol#L10
Vulnerability details
Impact
The
CamelotRelayer
uses theOracleLibrary
as an interface for accessing oracle data from theCamelotPair
contract which is the Camelot DEX's equivalent of a pool using theOracleLibrary
fromUniSwapV3Pool
's periphery contracts but because theCamelotPair
doesn't implement the same interface as aUniSwapV3Pool
calls to theCamelotRelayer
's functions will revert.Proof of Concept
Calling the
getResultWithValidity
function inCamelotRelayer
tries to call thegetOldestObservationSecondsAgo
andconsult
functions in theOracleLibrary
.However when the
getOldestObservationSecondsAgo
tries to call theobservations
variable onIUniswapV3Pool
it will revert because there is noobservations
variable defined on theCamelotPair
pool.The same applies to the
consult
function which tries to call theobserve
function on theCamelotPair
pool which doesn't define this function.Tools Used
Manual Review
Recommended Mitigation Steps
Implement a CamelotRelayer that uses the interface of the
CamelotPair
to retrieve values.Assessed type
Context