Authorisation check for minting positions for V3 pools in the nfpManager
is pointing to the v2Factory
#3
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
primary issue
Highest quality submission among a set of duplicates
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
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-operation-contracts/blob/27f9d28e00958bf3494fa405a8a5acdcd5ecdc5d/src/governance/KatanaGovernance.sol#L332-L334
Vulnerability details
Impact
Part of function which checks, if a user is allowed to mint a position in a V3 pool through the
nfpManager
points to thev2Factory
and not thev3Factory
. This can lead to a situation where anyone is able to mint a position in a V3 pool even though the minting should be restricted. This renders the authorisation check in the nfpManager useless.Proof of Concept
When a user wants to mint a position in the
NonfungiblePositionManager
, it is first checked if he has the authorisation to do so:The checkPair function calls the governance function isAuthorized which in turn call the _isSkipped function to check if the authorisation for the pool (based on the tokens) should be skipped:
The
_isSkipped
function returns true and thereby authorises the caller to mint if the account isisAllowedActor
)allawedAll
).The issue arises from the fact that the user attempts to mint a position in a V3 pool but the
allawedAll
function checks the value ofallawedAll
in the v2 factory:This means that even if the user is not allowed to mint a position for a V3 pool, if
allowedAll
in the v2Factory is set to true he will be able to do so rendering the authorisation functionality of the nfpManager useless.Recommended Mitigation Steps
Consider adding another function to the governance contract for checking the authorisation for V3 pools which does not depend on the value of
allowedAll
in the_v2Factory
Assessed type
Access Control
The text was updated successfully, but these errors were encountered: