-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authorization function of the Governance can still restrict user from migrating v2 liquidity to v3 liquidity #31
Comments
|
The Warden attempts to breach an invariant of the system in relation to liquidity migrations due to improper enforcement of governance restrictions in the This particular submission is invalid given that the |
alex-ppg marked the issue as unsatisfactory: |
this is true, but this report says After the pool is created, the admin can still call the setPermission to block user from migrating the certain token's v2 position to v3. function setPermission(address token, uint40 whitelistUntil, address[] calldata alloweds, bool[] calldata statuses)
external
onlyOwner
{
_setPermission(token, whitelistUntil, alloweds, statuses);
} the doc says:
I read it as migration cannot fail after the pair is created, but let us say the RONIN / ETH pair is created, the admin remove the permission of ETH token, migrator call mint /// @inheritdoc INonfungiblePositionManager
function mint(MintParams calldata params)
external
payable
override
checkDeadline(params.deadline)
returns (uint256 tokenId, uint128 liquidity, uint256 amount0, uint256 amount1)
{
AuthorizationLib.checkPair(governance, params.token0, params.token1);
and. the code check if each token is [authorized[(https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/external/libraries/AuthorizationLib.sol#L7) note the check: function isAuthorized(address token, address account) public view returns (bool authorized) {
if (_isSkipped(account)) return true;
authorized = _isAuthorized(_permission[token], account);
}
/**
* @inheritdoc IKatanaGovernance
*/
function isAuthorized(address[] memory tokens, address account) public view returns (bool authorized) {
if (_isSkipped(account)) return true;
uint256 length = tokens.length;
for (uint256 i; i < length; ++i) {
if (!_isAuthorized(_permission[tokens[i]], account)) return false;
}
return true;
}
as for the comments:
the admin can first call setAllowedActor to make _isSkipped return false, then call the setPermission to block user from migrating the certain token's v2 position to v3. which violate the statement:
I politely think this issue should be a medium or grade a QA. thank you!. |
Hey @JeffCX, thanks for your PJQA contribution! Arguing for a medium-severity rating for this submission cannot be done in good faith in my opinion as it clearly demonstrates a would-be issue of negligible impact. While I can see how this could be argued as a QA severity issue, I still do not believe it constitutes an HM vulnerability and will retain an invalidation. |
https://code4rena.com/audits/2024-10-ronin this is the assumption in the doc page that should not be taken for granted.
If this assumption is broken, I think this QA should get some credit instead of invalidation. |
Lines of code
https://github.com/ronin-chain/katana-v3-contracts/blob/03c80179e04f40d96f06c451ea494bb18f2a58fc/src/periphery/V3Migrator.sol#L36
Vulnerability details
Proof of concept
The readme clearly say that once the pool is created and initialized,
the governance should not be able to block user from migrating their V2 position to V3.
Howver, this is not the case.
When migrating, this is the code:
then the code hits the NonfungiblePositionManager.sol#mint
this is calling checkPair
the governance code is:
After the pool is created, the admin can still call the setPermission to block user from migrating the certain token's v2 position to v3.
Recommendation
Strictly enforce that:
Assessed type
Access Control
The text was updated successfully, but these errors were encountered: