Because the capital pool's approve
function does not have any access control, anyone can call such function, and the specification that requires it to be only callable by the token manager is broken. Moreover, if a vulnerability is later found in the token manager so it needs to be replaced, allowing others to call this approve
function, just before such token manager is replaced, to make the capital pool to approve such vulnerable token manager to spend all of its tokenAddr
balance can cause the capital pool to lose its tokenAddr
balance.
Although the following approve
function's comment states that it only can be called by token manager
, such function does not have any access control for making it only callable by the token manager. In other words, anyone is allowed to call such function.
Since anyone can call the approve
function, the previously mentioned specification for such function is broken. If a vulnerability is later found in the token manager so it needs to be replaced, allowing others to call this approve
function, just before such token manager is replaced, to make the capital pool to approve such vulnerable token manager to spend all of its tokenAddr
balance can cause the capital pool to lose its tokenAddr
balance.
Manual Review
The capital pool's approve
function can be updated to implement an access control for making it only callable by the token manager.
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.