The whitelistModules function is responsible for whitelisting new modules in the contract. To ensure robustness and security, it is important to include checks for zero addresses and already whitelisted modules
Vulnerability Detail
Impact
Zero Address Check: The initial implementation did not check whether any of the addresses in the beacons_ array were zero addresses. Minting to or interacting with zero addresses is generally considered erroneous and can lead to lost tokens or other unexpected behavior.
Already Whitelisted Module Check: The initial implementation did not check if the module had already been whitelisted. This could result in the same module being added multiple times, leading to redundancy and potential logical errors.
NoOne
medium
Missing checks in
whitelistModules
Summary
The
whitelistModules
function is responsible for whitelisting new modules in the contract. To ensure robustness and security, it is important to include checks for zero addresses and already whitelisted modulesVulnerability Detail
Impact
Zero Address Check: The initial implementation did not check whether any of the addresses in the beacons_ array were zero addresses. Minting to or interacting with zero addresses is generally considered erroneous and can lead to lost tokens or other unexpected behavior.
Already Whitelisted Module Check: The initial implementation did not check if the module had already been whitelisted. This could result in the same module being added multiple times, leading to redundancy and potential logical errors.
Code Snippet
https://github.com/sherlock-audit/2024-03-arrakis/blob/main/arrakis-modular/src/abstracts/ArrakisMetaVault.sol#L139
Tool used
Manual Review
Recommendation