Submitted by cmichel, also found by WatchPug
Note that the PoolTemplate.initialize function, called when creating a market with Factory.createMarket, calls a vault function to transfer an initial deposit amount (conditions[1]) from the initial depositor (_references[4]):
The initial depositor needs to first approve the vault contract for the transferFrom to succeed.
An attacker can then frontrun the Factory.createMarket transaction with their own market creation (it does not have access restrictions) and create a market with different parameters but still passing in _conditions[1]=amount and _references[4]=victim.
A market with parameters that the initial depositor did not want (different underlying, old whitelisted registry/parameter contract, etc.) can be created with their tokens and these tokens are essentially lost.
Can the initial depositor be set to Factory.createMarkets msg.sender, instead of being able to pick a whitelisted one as _references[4]?
oishun1112 (Insure) confirmed:
