contracts/core/collectors/Treasury.sol
The withdraw function in the Treasury contract is responsible for managing token withdrawals from the the contract, it updates its internal accounting of total value of tokens in the contract (_totalValue) and the balance of the token remaining in the contract (_balances[token]).
However, since tokens directly transferred into the contract (without using the deposit function) are not accounted for internally, they would not be able to be withdrawn using the withdraw function since that would lead to an underflow when deducting the amount from the token balances tracked internally within the contract.
Tokens transferred to the contract directly (intentionally or mistakenly) will be ultimately locked even though the withdraw function can withdraw any token from the contract.
Manual Review
Refactor the internal token accounting to take into consideration that tokens can be directly transferred to the treasury contract (without using the deposit function) hence allowing withdrawals of entire balances.
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.