The withdrawAllFailedCredits function is intended to provide a mechanism for users to claim ETH that failed to transfer during payouts (e.g., refunds to previous bidders or seller proceeds), by allowing the rightful owner of the credits to withdraw them securely to their address.
Due to a logic error, the function fetches the credit amount associated with the specified _receiver but then clears the credits for msg.sender and transfers the amount to msg.sender, allowing an attacker to steal credits from any address by providing the victim's address as _receiver, effectively draining funds meant for others while only affecting their own (possibly zero) credit balance.
Likelihood:
Payouts fail for users who are non-ETH-receivable contracts, accumulating credits in the mapping
Attackers monitor the contract state or events for non-zero failedTransferCredits balances and execute the theft
Impact:
Victims lose their entitled funds (refunds or proceeds), leading to direct financial harm
Erosion of platform trust, potential legal issues, and discouragement of contract-based users participating as sellers or bidders
Add the following test function into the existing tests in BidBeastsMarketPlaceTest.t.sol
Restrict withdrawals to the owner's own credits by adding a require check and correcting the clearing and transfer to use _receiver consistently. This prevents third-party access and ensures secure claims. Alternatively, remove the _receiver parameter entirely and always use msg.sender for simplicity.
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.