Attacker can make escrow creation of users fail by frunt-running the buyer who is trying to create newEscrow
.
in the EscrowFactory.sol
contract the newEscrow
function need to generate addresses in address computedAddress = computeEscrowAddress(
part which is using computeEscrowAddress
and because this computeEscrowAddress
function using CREAT2 method to generate addresses attacker can easily grief the users and block them from creating newExcrow
and make protocol useless and broken
attacker can frontrun the creation TX with their own creation
request, with the same parameters. This would create the exact address created by the
CREATE2 call, since the parameters and therefore the final salt will be the same. When the
victim's transaction would be executed, the computed address is non-empty so the EVM would reject
its creation.
the users will not be able to create newEscrow
anymore because of bad actors. and bad actors can even set bot and make contract unusable forever.
https://github.com/Cyfrin/2023-07-escrow/blob/65a60eb0773803fa0be4ba72defaec7d8567bccc/src/EscrowFactory.sol#L77
manually vs code
The best implementation for this issue is using an ever-increasing nonce counter to guarantee unique contract addresses.
like this
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.