code4rena-2023-01-biconomy-l08
[L-08] No Storage Gap for BaseSmartAccount and ModuleManager
Summary
upgradable 컨트랙트가 상속하는 자식 컨트랙트에 storage gap을 넣지 않았음을 지적했다.
Keyword
upgradable, slot collision, gap
Vulnerability
- contracts/smart-contract-wallet/BaseSmartAccount.sol#L33
- contracts/smart-contract-wallet/base/ModuleManager.sol#L9
upgradable 컨트랙트에서 상속하는 컨트랙트에 storage gap이 없음을 지적했다.
Impact
추후 자식 컨트랙트에 변수를 추가하는 경우 기존 변수와 slot이 충돌하게 된다.
Mitigation
uint256[50] private __gap; 을 맨 마지막 변수로 넣어 gap을 추가한다.
tags: bughunting, smart contract, biconomy, account abstraction, erc4337, upgradeable, solidity storage, slot collision, wallet, severity low, memory corruption