Tadle

Tadle
DeFi
30,000 USDC
View results
Submission Details
Severity: low
Invalid

Approve in Capital Pool does not check for return value

Summary

The approve in capital pool.sol Tries to call approve from the token address. However most ERC20 tokens return a boolean when they are completed. The method used in Capitol pool .sol doesn't try to store, decode the boolean value.

Vulnerability Details

function approve(address tokenAddr) external {
address tokenManager = tadleFactory.relatedContracts(
RelatedContractLibraries.TOKEN_MANAGER
);
@> (bool success, ) = tokenAddr.call(
abi.encodeWithSelector(
APPROVE_SELECTOR,
tokenManager,
type(uint256).max
)
@> ); //@audit return value decode not done. for OZ based ERC20s.
if (!success) {
revert ApproveFailed();
}
}

Impact

The impact is that most tokens which wouldn't have approved might show it as approved as the method to approve amount in that token address is invalid. This breaks most flow related to withdrawals from capital pool.sol

Tools Used

manual analysis

Recommendations

Store return value and decode it as boolean, along with checking just the succeeded call.

Updates

Lead Judging Commences

0xnevi Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Too generic
Assigned finding tags:

[invalid] finding-CapitalPool-approve-return-boolean

Invalid, low level call will always return true as long as the call succeeds without reverting, so this has no impact described, given approvals can only fail when some weird tokens do not allow a uint256.max approval, which is not described in any of the issues below.

Support

FAQs

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