0x73696d616f - Admin will not be able to upgrade the smart contracts, breaking core functionality and rendering the upgradeable contracts useless #185
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A Medium severity issue.
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
0x73696d616f
Medium
Admin will not be able to upgrade the smart contracts, breaking core functionality and rendering the upgradeable contracts useless
Summary
The AssetFactory and FlashSwapRouter inherit the
UUPSUpgradeable
contract in order to be upgradeable. However, AssetFactory::initialize(), FlashSwapRouter::initialize(), AssetFactory::_authorizeUpgrade() and FlashSwapRouter::_authorizeUpgrade() have thenotDelegated
, which means they can not be called in the context of a proxy, hence they can not be upgradeable.This renders the inherited
UUPSUpgradeable
useless and the 2 contracts will not be upgradeable. Additionally, the AssetFactory and FlashSwapRouter contracts are not deployed behind proxies, meaning that this problem would be noticed when trying to upgrade and failing.Root Cause
In
AssetFactory.sol:48
,AssetFactory.sol:195
,FlashSwapRouter.sol:32
andFlashSwapRouter.sol:41
thenotDelegated
modifiers are used.Internal pre-conditions
None.
External pre-conditions
None.
Attack Path
Admin tries to upgrade the
AssetFactory
andFlashSwapRouter
contracts but fails.Impact
The
UUPSUpgradeable
contract is rendered useless, which means theAssetFactory
andFlashSwapRouter
contracts can not be upgraded. This leads to breaking major functionality as well as the possibility of stuck/lost funds.PoC
FlashSwapRouter
AssetFactory
Mitigation
Remove the
notDelegated
modifiers.The text was updated successfully, but these errors were encountered: