Description:
The buyOrder
function in the OrderBook.sol
contract does not validate that the order's buyer (msg.sender
) is different from the order's seller (order.seller
). This absence of a check allows a user to create a sell order and then execute a purchase on that same order.
Impact:
This vulnerability enables "wash trading," where a user can artificially inflate the trading volume on the platform by buying their own assets. While the user would incur a protocol fee for each transaction, this could be used to create a misleading appearance of high market activity. Prospective users might be deceived by these inflated volumes, leading them to misjudge the platform's liquidity and make uninformed trading decisions. This can damage the platform's reputation and user trust.
Recommended Mitigation:
Implement a require
statement or a custom error at the beginning of the buyOrder
function to ensure that the buyer and seller are not the same 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.