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

Orchestrator_v1.sol#initiateAddModuleWithTimelock() - indefinite amounts of privileged modules can be added #86

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

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

Github username: @PlamenTSV Twitter username: @p_tsanev Submission hash (on-chain): 0x9b871e35b67ba70c4c6d699c71f6dfc078961e685c1410edccdcda2d043cf6fd Severity: low

Description: Description\ The initiateAddModuleWithTimelock() is meant to add new logic modules to the Orchestrator. It's counter-parts for privileged modules:

Attack Scenario\ initiateAddModuleWithTimelock():

function _initiateAddModuleWithTimelock(address module)
        internal
        __ModuleManager_onlyAuthorized
        moduleLimitNotExceeded
        isNotModule(module)
        validModule(module)
    {
        _startModuleUpdateTimelock(module);
    }

As it can be seen, the function only checks the validity, dupes and limit of modules. However if the new module is a privileged module, it can be freely added without removing the old privileged onces, differing from the intended behavior.

Attachments

  1. Proof of Concept (PoC) File

  2. Revised Code File (Optional)

Recommendation\ Aswell as checking if the module supports the IModule_v1 interface, it should also be checked if the module supports one of the privileged interfaces and revert if it does.

FHieser commented 5 months ago

isnt this a copy of #77 or #78

PlamenTSV commented 5 months ago

77 and #78 talk about completely different functions than the ones mentioned above. Fixing them does not fix this issue here.