A transfer that is not validated its result.
The withdraw() function does not check whether the token transfer succeeded, so a failed transfer could go unnoticed. An attacker could exploit this by using a token that returns false on transfer, potentially causing the contract to misbehave.
Originally disclosed on Code4rena
Submitted by fatherOfBlocks
When the transfer is made in the withdraw() function, it is not validated if the transfer was done correctly.
This could be a conflict since not being able to perform it would return a false and that case would not be handled, the most common is to revert.
Recommended Mitigation Steps
The recommendation is to wrap the transfer with a require, as is done in MerkleDropFactory.sol for example.
illuzen (FactoryDAO) acknowledged and commented:
Malicious or otherwise bad tokens are considered acceptable risks for this contract as long as they cannot interfere with other trees.
illuzen (FactoryDAO) resolved:
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the return value of the token transfer call is not checked, so a failed transfer is not reverted.
Impact
A malicious token could cause the withdraw function to not revert on failure, potentially interfering with other trees, though the team considers bad tokens an acceptable risk if they cannot interfere with other trees.
What the attacker needed
A malicious or bad token; withdraw function called
The fix
The transfer should be wrapped with a require statement to ensure it succeeds, as done in MerkleDropFactory.sol.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a smart contract sends tokens, it should check that the transfer actually worked. Here, the code ignores the result, so if the transfer fails, the contract might think it succeeded. This could let someone use a fake token to trick the contract.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.