Tadle

Tadle
DeFi
30,000 USDC
View results
Submission Details
Severity: high
Valid

attacker can drain all of the protocol funds through TokenManager::withdraw

Summary

Vulnerability Details

in TokenManager::withdraw

https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/TokenManager.sol#L137-L181

attcker can exploit this function by reentrancy due to lack of balance update before transfer is made or nonReentrant modifier, and this will lead to drain all the protocol funds

Impact

loss of funds

Tools Used

Recommendations

set the user balance to zero before transfer is made or add nonReentrant modifier.

Updates

Lead Judging Commences

0xnevi Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-TokenManager-withdraw-userTokenBalanceMap-not-reset

Valid critical severity finding, the lack of clearance of the `userTokenBalanceMap` mapping allows complete draining of the CapitalPool contract. Note: This would require the approval issues highlighted in other issues to be fixed first (i.e. wrong approval address within `_transfer` and lack of approvals within `_safe_transfer_from` during ERC20 withdrawals)

Support

FAQs

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