The Treasury contract maintains an allocation system that tracks fund allocations to recipients but fails to decrease these allocations when actual withdrawals occur, leading to an inconsistent state between allocated and actual funds.
When manager allocates funds, it is added to the mapping, but when the withdraw happens there is no check to see if manager is withdrawing more than allocated funds for that recipeint.
The core issue lies when withdrawing:
When a withdrawal happens, the actual tokens are transferred, but the allocation records remain unchanged. This means:
An allocator could allocate 100 tokens to a recipient
The tokens could be withdrawn to that recipient
The allocation still shows 100 tokens even though they've been withdrawn
The managers can overspend on recepients.
This creates a phantom allocation where the system thinks funds are still allocated even after they've been disbursed.
Alice (Allocator) allocates 100 tokens to Bob: allocateFunds(bob, 100)
Manager withdraws 100 tokens to Bob: withdraw(token, 100, bob)
Check allocation: getAllocation(alice, bob)
still returns 100
But actual tokens have been transferred and _balances
is reduced
This creates an inconsistent state where allocations don't reflect reality
Manager can now withdraw more than allocated tokens to the Bob.
Risk of double-spending against allocations
Incorrect allocation tracking
Potential over-allocation of funds
Misleading allocation records
Manual code review
Update the withdraw function to handle allocations:
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.