The CapitalPool::approve function lacks a check to ensure that only whitelisted tokens can be approved, potentially allowing approvals for non-ERC20 or malicious tokens.
The approve function does not verify if the token being approved is whitelisted in the TokenManager. This oversight could lead to approvals of unauthorized or potentially malicious tokens.
Potential approval of non-whitelisted or malicious tokens.
Risk of interacting with non-standard token contracts.
Inconsistency with the protocol's token whitelist policy.
Foundry
Add a getter function to view whitelisted tokens in TokenManager and implement it in ITokenManager:
Import ITokenManager & Implement a whitelist check in the CapitalPool::approve function:
Consider using the IERC20 interface for the approve call instead of a low-level call:
This is at most low severity, even though giving max approvals shouldn't be permisionless, the respective tokenManager address is retrieved from the TadleFactory contract whereby the trusted guardian role is responsible for deploying such contracts as seen [here](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/factory/TadleFactory.sol#L68). Since the user still has to go through the PreMarkets/DeliveryPlace contracts to perform market actions, this max approval cannot be exploited.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.