hats-finance / Inverter-Network-0xe47e52c4fea05e555920f1dcdcc6fb8eca103eeb

Fork of the Inverter Smart Contracts Repository
GNU Lesser General Public License v3.0
0 stars 3 forks source link

Inadequate Module Limit Check in `moduleLimitNotExceeded` #57

Open hats-bug-reporter[bot] opened 5 months ago

hats-bug-reporter[bot] commented 5 months ago

Github username: @0xmahdirostami Twitter username: 0xmahdirostami Submission hash (on-chain): 0xb8eedb908d24277cd9db9f758a64b4cf133a06f765db2918c89f65f3636b318d Severity: low

Description: Description: The moduleLimitNotExceeded function currently checks only the number of existing modules but does not account for modules that are pending addition. This oversight can allow the owner to initiate multiple initiateAddModuleWithTimelock calls, potentially bypassing the module limit.

Scenario: If there are already 127 modules and the owner calls initiateAddModuleWithTimelock, the current implementation will allow it. This process can be repeated, leading to a situation where the total number of modules, including pending ones, exceeds the allowed limit.

Mitigation: Update the moduleLimitNotExceeded check to include modules that are pending addition. Ensure that the check accounts for both existing modules and those that are in the process of being added, to prevent exceeding the maximum allowed number of modules.

FHieser commented 5 months ago

This is a valid find