Buyer or Seller can be set to the same address as the arbiter. The buyer or the seller who is also arbiter can call resolveDispute freely.
Vulnerability Details
In the Escrow contract constructor, it does not check if the buyer or seller is the same as the arbiter. If the buyer or seller is set to arbiter, the arbiter is no longer neutral.
When initiateDispute is called and a dispute arises, and the buyer or seller is arbiter, then buyer or seller can freely call resolveDispute to distribute tokens as desired.
Buyer or Seller and arbiter can be set to the same address
Severity
High Risk
Relevant GitHub Links
https://github.com/Cyfrin/2023-07-escrow/blob/65a60eb0773803fa0be4ba72defaec7d8567bccc/src/Escrow.sol#L32-L51
Summary
Buyer or Seller can be set to the same address as the arbiter. The buyer or the seller who is also arbiter can call
resolveDispute
freely.Vulnerability Details
In the Escrow contract constructor, it does not check if the buyer or seller is the same as the arbiter. If the buyer or seller is set to arbiter, the arbiter is no longer neutral.
When
initiateDispute
is called and a dispute arises, and the buyer or seller is arbiter, then buyer or seller can freely callresolveDispute
to distribute tokens as desired.https://github.com/Cyfrin/2023-07-escrow/blob/65a60eb0773803fa0be4ba72defaec7d8567bccc/src/Escrow.sol#L32-L51
Impact
The buyer or the seller who is also arbiter can call
resolveDispute
freely.Tools Used
vscode
Recommendations
In the constructor, check that the arbiter is neither a buyer nor a seller.