Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: low
Invalid

CapitalPool:approve () does not handle false return value of low level calls

Summary

Vulnerability Details

EIP20 states that:

  • Callers MUST handle false from returns (bool success). Callers MUST NOT assume that false is never returned!

However CapitalPool:approve () does not check the return value of the low lvl call to approve(address,uint256)

function approve(address tokenAddr) external {//@audit-issue tokenManager calls this.approve with his address instead of the WETH token!
address tokenManager = tadleFactory.relatedContracts(
RelatedContractLibraries.TOKEN_MANAGER
);
(bool success, ) = tokenAddr.call(// @< issue here, return value not checked
abi.encodeWithSelector(
APPROVE_SELECTOR,// q
tokenManager,
type(uint256).max
)
);

Impact

Inproper approval handling of ERC20 tokens. Allowance might not be achieved and subsequent transfers with allowance will fail

Tools Used

Manual review

Recommendations

Use OpenZeppelin SafeERC20.sol lib when interacting with ERC20 tokens

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol

Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year 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.

Appeal created

dinkras Submitter
about 1 year ago
0xnevi Lead Judge
about 1 year ago
0xnevi Lead Judge 12 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.