Tadle

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

Lack access control in contract CapitalPool::approve

Summary

* @notice only can be called by token manager

it was observed that the approve function in contract CapitalPool lacks proper access control. Although the function's comment indicates that it should only be called by the token manager, there is no implementation of this restriction in the code.

Vulnerability Details

The approve function is intended to be called only by the token manager, as indicated by the comment. However, the function does not implement any access control mechanisms to enforce this restriction.

Impact

  1. Unauthorized Access: Any external account can call the approve function, potentially allowing them to approve tokens for unauthorized use.

  2. Security Risks: Without restricting the function to the token manager, the contract is vulnerable to unauthorized actions that could lead to token mismanagement and potential loss of funds.

Tools Used

Manual Review

Recommendations

Ensure that the approve function can only be called by the token manager by adding a require statement to check the caller's address.

require(msg.sender == tokenManager, "Only token manager can call this function")
Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-CapitalPool-approve-missing-access-control

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.