Tadle

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

Arbitrary code can be run with CapitalPool as msg.sender

Summary

https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/CapitalPool.sol#L24C1-L24C51

Function approve(address) can be called by anyone with arbitrary tokenAddr argument.

Vulnerability Details

There is no restricted access implemented on the approve(address) function on the CapitolPool contract.

Impact

Arbitrary token approved to TokenManager OR arbitrary code execution with CapitalPool contract as the msg.sender as long as approve(address, amount) interface is implemented on the provided tokenAddr contract.

Tools Used

manual review

Recommendations

Restrict function call to TokenManager.

Updates

Lead Judging Commences

0xnevi Lead Judge over 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.

Give us feedback!