In the function to withdraw failed credits the input parameter is the address where there are unpaid funds. The function assumes that _receiver and msg.sender are the same and uses them interchangably but that leads to a problem as anyone can use any valid _receiver address and get funds from the protocol multiple times as the accounting changes msg.sender's mapping NOT the _receiver's.
The issue is easily exploitable with the following attack path:
User Bob deploys a contract to bid for him, the contracts can't recieve ether (rejector contract).
He picks an NFT with the lowest buyNowPrice.
Bob bids over the buyNowPrice through the rejector contract, making the accounting have a high failedTransferCredits[rejector] value.
Bob calls function withdrawsAllFailedCredit with the rejector address as the _receiver however many times he wants until he drains the protocol of all funds.
Paste the following test and the modified RejectEther contract into BidBeastsMarketPlaceTest.t.sol.
Allow either only msg.sender and _receiver to be the same address or make sure to send the funds strictly to _receiver.
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.