The TokenManager::withdraw
function in the Tadle
system allows users to withdraw claimable funds from the CapitalPool
. However, the function fails to update the userTokenBalanceMap
after a withdrawal, allowing users to repeatedly withdraw the same funds multiple times. This oversight can lead to the complete draining of the CapitalPool
.
The userTokenBalanceMap
in the TokenManager
contract tracks the claimable token balance for each user. The TokenManager::withdraw
function allows users to withdraw these claimable funds. However, the function does not update the userTokenBalanceMap
after a withdrawal is made, which creates a critical vulnerability.
The function retrieves the claimable amount from userTokenBalanceMap
but does not reset this balance after the withdrawal. As a result, users can repeatedly call the withdraw function to withdraw the same amount of tokens multiple times. This oversight can lead to the complete draining of the CapitalPool
for a specific ERC20 token.
The vulnerability has a high impact as it allows users to repeatedly withdraw funds, leading to the potential depletion of the CapitalPool
. This could result in significant financial losses and a complete failure of the system’s economic model.
Manual
The userTokenBalanceMap
should be updated after a withdrawal to prevent further claims on the same funds. Specifically, set the user’s balance to zero after the withdrawal.
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)
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.