Bid Beasts

First Flight #49
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: high
Valid

Free real ETH(don't take it seriously, it's my first try)

Root + Impact

Description

What should normally happened is only owner should recieve his failed transfer credits. But since there is no check on msg.sender == _reciever anyone can pass any address.


function withdrawAllFailedCredits(address _receiver) external {
uint256 amount = failedTransferCredits[_receiver];
require(amount > 0, "No credits to withdraw");
failedTransferCredits[msg.sender] = 0;
(bool success, ) = payable(msg.sender).call{value: amount}("");
require(success, "Withdraw failed");
}

Risk

Likelihood:

  • Anyone with such small brain as mine will drain this contract dry

  • Sorry I really suck putting words together

Impact:

  • Your marketplace is drained dry

Proof of Concept

What should be here? Like deployed contract on testnet and attacked?
I really don't get it

Recommended Mitigation

Follow CEI
Add reentrancy protection on function withdrawAllFailedCredits(address _receiver)
In function withdrawAllFailedCredits uint256 amount = failedTransferCredits[_receiver]; _reciever should be replaced with msg.sender
Updates

Lead Judging Commences

cryptoghost Lead Judge
about 2 months ago
cryptoghost Lead Judge about 1 month ago
Submission Judgement Published
Validated
Assigned finding tags:

BidBeast Marketplace: Unrestricted FailedCredits Withdrawal

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.