The CapitalPool::approve function is designed to authorize the token manager to spend tokens on behalf of the CapitalPool contract by calling the approve method with unlimited allowance type(uint256).max. However, there is no restriction on who can call this function (due to its external visibility), so that any user can call it:
Without proper access control, a malicious actor can call the CapitalPool::approve function to authorize the TokenManager to spend tokens from the CapitalPool contract. Although the address being approved (tokenManager) is not under the control of the attacker, the ability for anyone to trigger this approval undermines the intended access control and governance and could potentially lead to a series of further attacks, including unauthorized token transfers or possible draining of the CapitalPool. Thus the severity of this vulnerability can be rated as medium.
manual review, vscode
Adding access control to CapitalToken::approve function is crucial to prevent unauthorized actions and ensure the security and integrity of the protocol. Consider making the following changes to the CapitalToken.sol contract:
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.