User can pass 0 amount on Auction::buy which can be used in a malicious way
On Auction::buy we can see there is no limit check for putting a bid. As a result, a user can call a huge number of time the Auction::buy function with 0 amount in and as a result cause a DOS for all.
It's not about just only DOS, see the Impact section for more details.
Let's say a user A puts a bid but not a that much higher bid but higher than the previous one.
And he put the bid when the auction was nearly at the endTime.
So he is willing to win this bid. But any user can come and put a higher bid than user A and win the auction.
So, the A did some tricks.
After he put his bid higher than the previous one. He create a lots on buy with 0 amount, even though he is ready to pay higher gas fee.
So he block it for any further users and gonna win the auction as the auction was nearly end time.
So he actually win the auction. But the auction owner has lose money as there was another user to put higher value than A but the another user could not do that because the auction ended.
We can also see when the auction is ended the getPrice function returns different amounts.
So the auction owner is losing here because he was willing to get as high value as possible.
Even there is a possibility for a DOS even if the malicious user has no intention of winning the auction
Manual
Add a minimum amount for Auction::buy so that even if a user calls buy for a lot of time, it will be not profitable for him. Also not a loss for the Auction owner as he gets as higher value as possible.
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.