Closed howlbot-integration[bot] closed 3 weeks ago
alex-ppg marked the issue as not a duplicate
The Warden attempts to identify an issue with how the square root price is initialized, however, the TickMath::getTickAtSqrtRatio
function will properly ensure a valid ratio has been provided.
alex-ppg marked the issue as unsatisfactory: Invalid
alex-ppg marked the issue as primary issue
alex-ppg marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/core/KatanaV3Pool.sol#L255-L264
Vulnerability details
initialize()
function in KatanaV3Pool.sol lacks a crucial check to ensure that the providedsqrtPriceX96
parameter is non-zero. This oversight allows the pool to be initialized with an invalid price state, violating a fundamental invariant of the system.The reason is that in the initialize function, we directly assign the
sqrtPriceX96
parameter toslot0.sqrtPriceX96
without any validation: KatanaV3Pool.sol#L255-L264This assignment happens without any prior check to ensure sqrtPriceX96 is non-zero.
Impact
Some operations might consistently revert due to division by zero, effectively rendering the pool unusable.
Proof of Concept
initialize()
withsqrtPriceX96
set to 0Minimal PoC to demonstrate the issue
Recommended Mitigation Steps
Implement a check in the
initialize()
function to ensuresqrtPriceX96
is non-zeroAssessed type
DoS