The withdrawAllFailedCredits function should only let the rightful owner claim their failed transfer credits. Here, withdrawAllFailedCredits function lets any caller withdraw another user’s credits by passing in their address. If the contract still has enough ETH, the marketplace suffers the loss as it pays the attacker. If not, the user suffers the loss since their credits remain but the contract cannot cover them.
Likelihood:
Every time this function is called, an attacker can supply a victim’s address as _receiver.
This will drain the victim’s funds to the attacker..
Victims lose their failed transfer credits if the market has zero balance and if the market has ether it suffers the loss.
Before Testing this file add this setter function in the BidBeastsNFTMarketPlace.sol to enable us set the mapping
Here Is the POC
Restrict withdrawals to the caller’s own credits only:
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.