Skip to content
Business logic Audit finding Intermediate

`QVSimpleStrategy`: If someone fund a pool when the fund is partially/fully distributed, part of the fund may be locked

Anyone can add funds to a QVSimpleStrategy pool at any time, even after distribution has begun. Because recipients already paid out are marked as paid, newly added funds cannot be allocated to them and may become locked in the contract.

0xkaden Follow with ast3ros, branch_indigo and 6 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-09-Gitcoin-judging/issues/446

Found by

0xkaden, ast3ros, branch_indigo, jkoppel, lemonmon, lil.eth, nobody2018, rvierdiiev, wangxx2026 When Allo::fundPool is called when the funds are partially or fully distributed, the added funds may be locked.

Vulnerability Detail

Allo::fundPool can be called by anyone at anytime, and it will increase the BaseStrategy.poolAmount via BaseStrategy::increasePoolAmount().

https://github.com/sherlock-audit/2023-09-Gitcoin/blob/main/allo-v2/contracts/core/Allo.sol#L339-L345

The BaseStrategy.poolAmount storage variable is used to determine the payout of each recipient by QVBaseStrategy::_getPayout:

https://github.com/sherlock-audit/2023-09-Gitcoin/blob/main/allo-v2/contracts/strategies/qv-base/QVBaseStrategy.sol#L559-L574

When the fund is distributed by the pool manager via QVBaseStrategy::_distribute, the paidOut flag for the recipientId whose share was distributed will be set to be true.

https://github.com/sherlock-audit/2023-09-Gitcoin/blob/main/allo-v2/contracts/strategies/qv-base/QVBaseStrategy.sol#L458

The problem occurs when some funds are added when some funds are distributed. In the case, the funds will be partially or fully locked.

Impact

If some funds are added after the distribution is started, the added funds may be locked.

Code Snippet

https://github.com/sherlock-audit/2023-09-Gitcoin/blob/main/allo-v2/contracts/core/Allo.sol#L339-L345

https://github.com/sherlock-audit/2023-09-Gitcoin/blob/main/allo-v2/contracts/strategies/qv-base/QVBaseStrategy.sol#L559-L574

https://github.com/sherlock-audit/2023-09-Gitcoin/blob/main/allo-v2/contracts/strategies/qv-base/QVBaseStrategy.sol#L458

Tool used

Manual Review

Recommendation

Consider adding recoverFund function like other strategies. Alternatively, allow the fundPool function only before the distribution starts.

Discussion

jacksanford1

https://github.com/allo-protocol/allo-v2/pull/345

jack-the-pug

Fixed.

The original report as published on Sherlock, by 0xkaden. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the pool accepts new deposits at any time while tracking payouts with a per-recipient paid flag, so funds added after a recipient is paid have no remaining recipient to be allocated to.

Impact

Funds added after distribution has started may be partially or fully locked in the contract.

What the attacker needed

Anyone can call fundPool; distribution has started

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A funding pool lets people donate money that is later shared among recipients. The contract records who has already been paid so nobody is paid twice. If someone donates after payments have started, the money cannot be given to the already-paid recipients, so it can get stuck in the contract with no way to withdraw it.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by 0xkaden

View all

11 more disclosed reports, best first.

More from Allo V2

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.