Katana Governance will never be able to initialize the V3factory because of a wrong check #50
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-26
🤖_primary
AI based primary recommendation
🤖_100_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/KatanaV3Factory.sol#L32-L35
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/core/KatanaV3Factory.sol#L46-L74
Vulnerability details
Proof of Concept
** Summary **
The Katana governance system cannot initialize the
v3Factory
due to an incorrect check within theinitialize
function. When thev3Factory
is deployed, the constructor sets thebeacon
address toaddress(1)
, disabling initialization by default. However, when theinitialize
function is called, it checks ifbeacon
isaddress(0)
instead ofaddress(1)
, causing the function to revert every time. This misconfiguration blocks the governance system from setting key parameters and using thev3Factory
.** Vulnerability Details **
In the current setup, when the
v3Factory
is deployed, the constructor includes this line:This line sets the
beacon
address toaddress(1)
, effectively disabling the initialization until it’s called with valid parameters. However, theinitialize
function attempts to validate the uninitialized state of thebeacon
by checking foraddress(0)
, which will always fail and cause a reversion. This prevents any further setup for governance, as initialization cannot proceed.** Code Reference **
initialize
Function with Incorrect Check** Impact **
This misconfiguration in the
initialize
function has significant implications:v3Factory
, preventing essential operations, such as setting fees and controlling the factory.v3Factory
configuration, the system becomes incomplete and non-functional in its intended capacity.Recommended Mitigation Steps
To resolve this issue, update the check in the
initialize
function to confirm ifbeacon
is set toaddress(1)
instead ofaddress(0)
. This will align with the constructor configuration and allow theinitialize
function to proceed only whenbeacon
isaddress(1)
.Updated
initialize
Function Recommendation:Assessed type
DoS
The text was updated successfully, but these errors were encountered: