When a multi-type module that includes MODULE_TYPE_VALIDATOR
is uninstalled by their another type, this can bypass the check that there must still be one functional validator installed in the wallet. After uninstallation, the smart account could be permanently unusable.
The Nexus Smart Accounts allows for installing modules of multiple types. However, the uninstallation process requires the module to be uninstalled by each type. If a multi-type module is uninstalled by a type other than MODULE_TYPE_VALIDATOR
, the system may bypass the check that ensures at least one validator remains installed in the wallet.
This bypass can occur when a module acting as MODULE_TYPE_VALIDATOR
and another type (e.g., HOOK
, EXECUTOR
, FALLBACK
) is uninstalled. Consequently, the smart account could be left without a functional validator, making it permanently unusable.
If a multi-type module that includes MODULE_TYPE_VALIDATOR
is uninstalled by a secondary type (e.g., HOOK
, EXECUTOR
, FALLBACK
), the smart account can be left without a functional validator.
This conflict with the requirement that at least one functional validator must always be present. Consequently, the smart account becomes permanently unusable, failing to validate UserOperations
and rendering the account inoperative.
However, this is likely to be an edge case, so the likelihood can be considered as LOW
, but the impact is believed to be HIGH
.
Initial State:
Using the Core Modules for Smart Accounts:: DeadmanSwitch{}
module as an example of the MULTI-MODULE
contract that functions as the type: TYPE_VALIDATOR
and TYPE_HOOK
.
The DeadmanSwitch
module is chosen as an example because it is an ERC-7579 standard module and is commonly used with Modular Smart Accounts
compliant with ERC-7579
and ERC-4337
.
Step 1:
The user deploys the smart wallet and installs the DeadmanSwitch
module using the RegistryBootstrap::initNexusScoped()
function, which allows the user to initialize a Nexus account with the TYPE_VALIDATOR
and TYPE_HOOK
modules.
After installation, the user can use the smart wallet to support validation when EntryPoint
calls and execute hooks as expected.
Step 2:
The user uninstalls the module by calling Nexus::uninstallModule(moduleTypeId: MODULE_TYPE_HOOK, module: DeadmanSwitch, _)
. The uninstallation is successful, and the module triggers onUninstall()
.
This step bypasses the condition that the account retains at least one validator
(ModuleManager::_uninstallValidator()) as theVALIDATOR
becomes unusable.
Outcome: The smart account becomes permanently inoperable as it fails to validate the UserOperation
.
Manual Review
There is no code recommnedation but the optional approach provide below:
Require that the smart wallet must retain at least one ONE_TYPE_VALIDATOR
module as default.
Ensure that the uninstallation logic properly handles multi-type modules and retains at least one functional validator.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.