In the Treasury.sol contract the withdraw function is missing an allocation check and update for the recipient, which can lead to improper management of allocated funds.
The vulnerability arises from the absence of a check for allocated funds in the withdraw function. When a withdrawal is made, the function does not verify if the recipient has an allocated amount and does not update the allocation accordingly. This can result in allocated funds being withdrawn without proper tracking, leading to discrepancies in fund management.
Without proper allocation checks and updates, the protocol will allow withdrawals that exceed the allocated amounts, leading to potential financial mismanagement. Allocated funds are intended to be reserved for specific purposes or recipients, and bypassing this mechanism can result in funds being misused or depleted prematurely. This undermines the integrity of the fund allocation system and can lead to financial losses for the protocol and its users.
Manual Review
To mitigate this vulnerability, implement an allocation check and update in the withdraw function. This ensures that withdrawals respect the allocated amounts and properly update the allocation records. Here is an example of how to implement this:
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.