Open hats-bug-reporter[bot] opened 2 months ago
Thank you for your report on the proxy creation method. After review, we've determined this is not an issue.
The scenario described is not applicable. Our contract deployment process is secure.
We appreciate your participation in this security review.
@benjaminbollen Hey again Ben, would like to escalate this as well. The fix for this issue revolves around very minimal change and eliminates a lot of risk that your protocol takes on board. What makes this scenario not applicable for circles?
normal create is not insecure
also see #7 ; the whole "reorg attack" is false
Github username: -- Twitter username: -- Submission hash (on-chain): 0xf552593c0d5c1552511ce724812fd6507b06368445b26b40604d28d680bf6087 Severity: low
Description: Description There is a vulnerability within the
ProxyFactory
contract's method of creating new proxy contracts. The_createProxy
function uses thenew
keyword to deploy newProxy
contracts, which internally utilizes thecreate
opcode. This approach makes the contract creation process susceptible to reorganization (reorg) attacks, particularly on Layer 2 (L2) solutions and EVM-compatible chains that are more prone to reorgs.The vulnerability arises because the address of the newly created proxy contract is determined solely by the nonce of the factory contract. During a blockchain reorganization, this nonce can change, potentially resulting in the proxy being deployed at an unexpected address.
Attack Scenario
ProxyFactory
.ProxyFactory
contract's nonce may change due to the reorg.This scenario can lead to:
Attachments
import "./Proxy.sol";
contract ProxyFactory { event ProxyCreation(Proxy proxy, address masterCopy);
@> proxy = new Proxy(masterCopy); // Vulnerable line if (data.length > 0) { assembly { if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) { revert(0, 0) } } } emit ProxyCreation(proxy, masterCopy); } }
The revised code demonstrates the use of
create2
for proxy contract deployment. By usingcreate2
with a salt that includesmsg.sender
, we ensure that the proxy contract's address will be consistent even in the event of a blockchain reorganization, as long as the same salt is used by the same sender. This significantly reduces the risk associated with reorg attacks during proxy contract deployment.