failedTransferCredits mapping is updated for caller address instead of receiver in withdrawAllFailedCredits function, lead to drain market by hackerfailedTransferCredits updates for receiver address which accidently could not receive ether while calling _payout function, so that they can withdraw their funds later.
In withdrawAllFailedCredits function the receiver perameter has been passed for withrawing funds. But instead updating mapping for receiver address the function is updating mapping on caller address. that means the mapping for receiver address is as it is. which opens doors for attackers.
Likelihood:
Attacker saw a transaction in mempool, that updated failedTransferCredits mapping for some user. they can simple pass the user address and get their money and call function repatedly to drain whole market.
Impact:
High impact because it directly targets the users funds.
High impact because it can also steal protocol fees if for some reason owner could not receive ether in _payout function
consider to make suggested changes to function, that will prevent the attacker to steal someone money by simply calling it. After making changes the receiver will get money and mapping updated for receiver only even if it called by the attacker.
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.