V3factory will fail to initialize because of a wrong check #38
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-26
🤖_04_group
AI based duplicate group recommendation
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/core/KatanaV3Pool.sol#L122
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/core/KatanaV3Pool.sol#L112-L113
Vulnerability details
Proof of Concept
The
initialize
function in the v3Katanapool contract has a misconfiguration that causes it to revert unexpectedly, preventing initialization of the pool parameters. Here’s an analysis of the code and impact:Issue: When the
initialize
function is called, it checks iffactory
isaddress(0)
rather thanaddress(1)
. This check fails each time because the constructor setsfactory
toaddress(1)
, causing theinitialize
function to revert and halt the pool setup.Code Reference:
v3Pool
, effectively making the system unusable until corrected.Recommended Mitigation Steps
To fix this issue:
Solution: Modify the
initialize
function's check to ensurefactory
is set toaddress(1)
instead ofaddress(0)
.Code Update:
Assessed type
DoS
The text was updated successfully, but these errors were encountered: