TSender

Cyfrin
DeFiFoundry
15,000 USDC
View results
Submission Details
Severity: low
Invalid

No token address validation

Summary

No token address validation

Vulnerability Details

With 0x0 adress contract still accept and transfers and can waste gas .There's no zero address check even in areListsValid which can be set and evade this problem

function test_airDropErc20ToManyByMaliciousUser() public virtual {
address sender=makeAddr("sender");
// Arrange
uint256 uint256Amount = 1 ether;
uint256 expectedTotalAmount = (uint256Amount * 2) + ONE;
vm.startPrank(sender);
mockERC20.mint(expectedTotalAmount);
mockERC20.approve(address(tSender), expectedTotalAmount);
vm.stopPrank();
address[] memory recipients = new address[](2);
recipients[0] = recipientOne;
recipients[1] = recipientTwo;
uint256[] memory amounts = new uint256[](2);
amounts[0] = uint256Amount;
amounts[1] = uint256Amount + ONE;
// Act maliciousUser
vm.prank(sender);
tSender.airdropERC20(address(0), recipients, amounts, expectedTotalAmount);
}

Impact

Loss of gas

Tools Used

Manuel review

Recommendations

set validation inside areListsValid function.

Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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