The withdraw
function in the auction contract allows multiple withdrawals, due to the failure to reset user's bid amounts after a successful withdrawal. As a result, a user can repeatedly call the withdraw
function and drain the contract’s funds.
Once a user calls withdraw
, the amount they previously bid is transferred to their account. However, since their entry in the bid_values
mapping is not updated to 0, they can call the withdraw
function again and keep withdrawing the same amount.
This vulnerability is high severity because it enables malicious actors to drain the contract’s funds. By repeatedly withdrawing their bid amount without it being reset, they can take more tokens than they initially bid.
Manual Code Review, VSCode
To prevent users from withdrawing multiple times, reset their bid amount in the bid_values
mapping to 0 after a successful withdrawal:
The `withdraw` function doesn't reset the `bid_values` to 0 after the withdraw. That means the bidder can call multiple time the `withdraw` function and receive the whole balance of the protocol.
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.