The CapitalPool::approve
function is intended to be called only by the TokenManager
, as stated in the function's documentation. However, there is no access control check to enforce this restriction. This oversight allows any external address to call the function.
The approve
function is designed to approve the TokenManager
to spend tokens on behalf of the CapitalPool
, facilitating user withdrawals. However, there is no access control check in place to ensure that only the TokenManager
can call this function, despite this being a critical requirement as per the function's documentation. The lack of such a check could allow malicious actors to call the function and manipulate token approvals.
The lack of access control on the approve
function could lead to unauthorized token approvals, potentially allowing malicious actors to manipulate token transfers. This could result in significant financial losses for the protocol and its users
Manual code Review
Implement an access control check to ensure that only the TokenManager
can call the approve
function. This can be done by adding a require statement that checks the caller's address:
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.