Excess ETH sent during the buyOrder function is not refunded to the buyer, leading to permanent loss of funds.
In the buyOrder
function, the contract checks if the msg.value
is greater than or equal to the required amount (order.price + sellerFee
). However, if the buyer sends more ETH than required, the excess ETH remains stuck in the contract. There is no mechanism to refund the excess ETH to the buyer.
Users who send more ETH than necessary will lose their funds permanently or ETH sent accidentally (e.g., via selfdestruct
or a direct transfer) cannot be recovered.
This can lead to significant financial losses, especially for high-value transactions.
The contract will accumulate unnecessary ETH over time, which could be exploited or cause operational issues.
Manual code review.
Calculate the excess ETH (msg.value - totalRequired
) and refund it to the buyer using transfer
or call
.
Ensure the contract only accepts the exact amount of ETH required for the transaction, or explicitly handle excess ETH.
Add a function to allow the owner to withdraw any accidentally locked ETH, ensuring transparency and control over the contract's balance.
The extra eth sent by the user in the buy order will be locked in the contract forever
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.