The EscrowFactory.computeEscrowAddress()
can return an incorrect predicted address
to an external caller.
The EscrowFactory.computeEscrowAddress()
is defined as a public function, allowing both an external caller and the EscrowFactory
contract itself (i.e., the newEscrow()
) to execute it.
In case of an external call, if a caller inputs the deployer
parameter incorrectly, the computeEscrowAddress()
will return an incorrect predicted address
since the inputted deployer
parameter will be used for computing the predicted address.
https://github.com/Cyfrin/2023-07-escrow/blob/65a60eb0773803fa0be4ba72defaec7d8567bccc/src/EscrowFactory.sol#L58
https://github.com/Cyfrin/2023-07-escrow/blob/65a60eb0773803fa0be4ba72defaec7d8567bccc/src/EscrowFactory.sol#L73
The EscrowFactory.computeEscrowAddress()
can return an incorrect predicted address
if an external caller inputs the deployer
parameter incorrectly.
Manual Review
I recommend hard-coding the deployer
parameter with the address(this)
instead, as shown below.
This will guarantee that no matter whether an external caller or the EscrowFactory
contract itself (i.e., the newEscrow()
) will execute the computeEscrowAddress()
, the function will return a correct predicted address
.
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.