Closed sherlock-admin4 closed 2 months ago
1 comment(s) were left on this issue during the judging contest.
z3s commented:
invalid due to sherlock rules and criteria not being met. Chain re-org and network liveness related issues are not considered valid. Exception: If an issue concerns any kind of a network admin (e.g. a sequencer), can be remedied by a smart contract modification, the protocol team considers external admins restricted and the considered network was explicitly mentioned in the contest README, it may be a valid medium. It should be assumed that any such network issues will be resolved within 7 days, if that may be possible.
EgisSecurity
Medium
Blockchain reorgs may result in locked funds for the victim
Summary
SuperPoolFactory#deploySuperPool is vulnerable to reorg attack issues, because it uses
create
opcode. This opcode uses only the deployer address + deployer address nonce (count of deployed contract) to calculate the address of the new SuperPool, which is being deployed. In the contest README it is written that compatible chains are all EVM chains. We assume Mainnet and Polygon are valid chains for this scope, as those are the chains with the most frequent and deep reorganizations.Root Cause
Using
create
when deployingSuperPool
fromSuperPoolFactory
Internal pre-conditions
SuperPoolFactory#deploySuperPool
External pre-conditions
SuperPoolFactory#deploySuperPool
transactionAttack Path
Imagine the following scenario:
SuperPoolFactory#deploySuperPool
and that operation returnsfirstSuperAddress
firstSuperAddress.deposit
with amount of 10 WETHSuperPoolFactory#deploySuperPool
, which will be before the victim's transaction after the reorg, which will result infirstSuperAddress
, but with the exploiter as owner/modifier of the pool.deposit
transaction is still usingfirstSuperAddress
firstSuperAddress
and calls SuperPool#reallocate with the base pool that he has just created and all 10 WETH of the victim.Impact
PoC
No response
Mitigation
Use
create2
while deploying the super pools and use owner's address for the salt.Duplicate of #115