Submitted by ljmanini
VaultDeployer deploys instances of the Vault contract using create, where the address derivation depends on the senders address (= VaultDeployer) and its nonce.
Although the system is intended to be deployed on Ethereum, there still have been instances of chain reorgs in its PoS era : ref.
The frequency and depth of reorgs only increases in alternative L1s and L2s such as polygon and optimism, where reorgs have reached 100+ block depth : ref.
In a scenario in which a users Vault deplyoment and deposit is included fully within a reorg, an attacker is able to frontrun the users Vault deployment, effectively stealing the Vault instance at that particular address, include the users deployment (which will deploy a new Vault at a new, unrelated address) and his deposit to the originally deployed Vault, and finally backrun the users deposit by pulling funds from the Vault.
In order to pull off this attack successfully, the attacker needs to take care of some details:
Once the victims deposit has been executed, the attacker can chose to pull the users funds from the compromised Vault by calling Vault.controllerTransfer through his malicious VaultController
Given the high impact of this finding but its low likelihood, Im submitting this as a medium severity issue.
Deployments of Vault instances should be done employing create2 with a salt calculated based on id, minter and msg.sender.
