QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: low
Invalid

Admin Call to UpdateWeightRunner functions Reverts When Owner Has Update Permission

Summary

For a pool, the Quantamm admin’s call updateWeightManually() in UpdateWeightRunner.sol reverts if the pool’s owner has the permission to update weights.

.

NOTE: This might be intentional to prevent the admin from interfering when a pool has a manager or owner.

However, the admin can bypass this restriction by using the setApprovedActionsForPool() function. This lets the admin remove the manager’s permissions, giving them control to set weights manually.

NOTE: the same issue is in other functions like setIntermediateValuesManuallyVulnerabilit and initialisePoolLastRunTimeImpact

Detail

  1. A pool is configured where both owner update and admin update permissions are set:

    1. MASK_POOL_OWNER_UPDATES , MASK_POOL_QUANTAMM_ADMIN_UPDATES are set in pool

  2. The admin calls setWeightsManually in UpdateWeightRunner.sol to update the pool weights.

  3. The function first checks owner update permission:

if (poolRegistryEntry & MASK_POOL_OWNER_UPDATES > 0) {
require(msg.sender == poolRuleSettings[_poolAddress].poolManager, "ONLYMANAGER");

The condition is true, and the function reverts because the admin is not the pool manager.

So admin can not update weights, because owner update is permissioned!

To bypass this restriction:

  1. The admin calls setApprovedActionsForPool() to reset the owner update permissions of the pool.

  2. The admin successfully calls setWeightsManually and updates the pool weights.

NOTE: the same issue is in other functions like setIntermediateValuesManuallyVulnerabilit and initialisePoolLastRunTimeImpact

Impact

The admin is blocked from performing updates in pool when pool owner is permissioned

Tools Used

vscode

Recommendations

// Updated check for pool update permissions
// Ensure that only the owner or admin can update based on their respective permissions.
if (
((poolRegistryEntry & MASK_POOL_OWNER_UPDATES) > 0 && msg.sender == poolRuleSettings[_poolAddress].poolManager) ||
((poolRegistryEntry & MASK_POOL_QUANTAMM_ADMIN_UPDATES) > 0 && msg.sender == quantammAdmin)
) {
// Either owner or admin has permission and is trying to update
// Proceed with the update
} else {
// Revert if neither the owner nor the admin has permission
revert("NO_PERMISSION_TO_UPDATE");
}
Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

invalid_manual_functions_cannot_be_called_by_admin_when_pool_owner_can

Design choice confirmed by the sponsor.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!