The withdrawAllFailedCredits function contains a critical logic error that allows any user to drain all failed transfer credits from any other user's account. The function checks the credit balance of _receiver but incorrectly resets the credits of msg.sender, enabling malicious actors to repeatedly withdraw the same credits.
Likelihood:
Any user can exploit this vulnerability at any time
No special permissions or conditions required
An attack can be automated and repeated infinitely
Victims' failed credits remain untouched while the attacker drains the contract
Impact:
Complete drainage of the marketplace contract and users' funds
The test demonstrates a complete contract drain:
Attack Flow:
Setup: A contract (RejectEther) that can't receive ETH places a bid
Trigger: When outbid, the failed payout credits 1.1 ETH to RejectEther's account
Exploit: Malicious Drainer contract repeatedly calls withdrawAllFailedCredits(rejector)
Drain: Each call withdraws 1.1 ETH but never decrements the rejector's credits
Profit: Attacker extracts all marketplace funds until contract balance < 1.1 ETH
**Additional Security Improvement: **
Consider restricting withdrawal to only the credited address:
withdrawAllFailedCredits allows any user to withdraw another account’s failed transfer credits due to improper use of msg.sender instead of _receiver for balance reset and transfer.
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.