40,000 USDC
View results
Submission Details
Severity: low

L2: An attacker can hypotecally frontrun contrat creation and transfer funds before Escrow creation

L2: An attacker can hypotecally frontrun contrat creation and transfer funds before Escrow creation

Summary

Buyer need must approve the token contract to spend the price amount before calling this function.
Even if it’s highly improbable due to the create2 mechanism, some attacker could frontrun the contract creation to transfer funds. It will be safer and easier for users to add the approval in the newEscrow function.

Vulnerability Details

  1. The buyer gets computedAdress

  2. The buyer approves the token contract to spend the price.

  3. The buyer calls new Escrow with salt.

  4. Reading Mempool, frontRunner use an attacker smart contract with the same computed adress but with an function who create transfer funds to a given address. Even if no tool allowing this are avalaible, mitigation is cheap.

Impact

Loss of funds expected to be given to the Escrow Contract

Tools Used

None

Recommendations

Handle the allowances in the Escrow Factory.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.