Open c4-bot-3 opened 1 month ago
Note, this are not present in the automated finding report for known issues Grouping all input validation issues together. They should all likely be at most QA and argubly invalid based on the following READ.ME information:
Centralization risk. Sky Mavis is responsible for maintaining the Katana V3 contracts and will able to upgrade the contract if necessary, as well as specify additional fee tiers.
Lines of code
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/core/KatanaV3Pool.sol#L253-L267
Vulnerability details
Proof of Concept
The
initialize
function retrievesfeeProtocolNum
andfeeProtocolDen
from the factory contract usingIKatanaV3Factory(factory).feeAmountProtocol(fee)
. It then directly assigns these values toslot0.feeProtocolNum
andslot0.feeProtocolDen
without checking iffeeProtocolNum < feeProtocolDen
. This oversight in validation allows the pool to be initialized with a fee protocol ratio wherefeeProtocolNum
could be greater than or equal tofeeProtocolDen
.KatanaV3Pool.sol#L253-L262
Users may end up paying higher fees than expected or the protocol may collect more fees than intended. If a pool is initialized with an invalid fee protocol ratio (i.e.,
feeProtocolNum >= feeProtocolDen)
, it could lead to incorrect fee calculations and distributions.Recommended Mitigation Steps
Add a check in the
initialize
function to ensurefeeProtocolNum < feeProtocolDen
before setting the values inslot0
. Consider adding validation in the factory'sfeeAmountProtocol
function to always return values satisfying this condition.Assessed type
Invalid Validation