The Escrow smart contract presented in this analysis is designed to facilitate transactions between a buyer, seller, and an optional arbiter. The contract allows for the secure transfer of funds and goods/services based on predefined conditions. However, a critical security vulnerability has been identified in the contract related to the selection of the arbiter.
The vulnerability arises from the lack of validation in the contract to ensure that the arbiter is not the same individual as either the buyer or the seller. As a result, if the arbiter is also one of the parties involved in the transaction, they can potentially initiate a dispute and then manipulate the dispute resolution process in their favor to transfer funds unfairly.
If an unscrupulous individual serves as both the arbiter and a buyer/seller, they can exploit the contract's flaw to manipulate the outcome of the dispute resolution in their favor. This can lead to an unfair distribution of funds, compromising the intended security and integrity of the Escrow contract.
If the arbiter is also the buyer or the seller he can steal all the founds in the contract.
Manual review + forge test.
During contract initialization, implement a check to ensure that the arbiter's address is different from both the buyer and the seller. This validation step will prevent any conflicts of interest and ensure a neutral party acts as the arbiter.
if (arbiter == buyer || arbiter == seller) { revert Escrow__ArbitrerSameAsBuyerOrSeller(); }
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.