Executing funded standard proposals can be prevented by a proposal slate with duplicate proposals
The proposal slate validation function allows duplicate proposal IDs, so a malicious slate can be filled with the same proposal to maximise budget allocation. If this slate becomes the top slate, it cannot be replaced by a correct slate, preventing other funded proposals from being executed.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2023-01-ajna-judging/issues/119
Found by
berndartmueller
Summary
Anyone can propose a slate of standard proposals to be funded in a distribution period with the StandardFunding.checkSlate function. The proposal slate can contain duplicate proposal ids, which, if the slate is the top slate, can be used to prevent a standard proposal from being executed (funded).
Vulnerability Detail
A funded standard proposal is executed by calling the StandardFunding.executeStandard function. A proposal is considered successfully funded if its state returned by the GrantFund.state function is IGovernor.ProposalState.Succeeded. This is the case if StandardFunding._standardFundingVoteSucceeded returns true.
StandardFunding._standardFundingVoteSucceeded checks if the given proposal id is included in the currently funded proposal slate.
However, as mentioned in the beginning, the proposal slate can contain duplicate proposal ids. A slate can therefore be maximized (in regard to the allocated budget) with the same proposal id. Worst case, this "malicious" slate can not be replaced with a correct slate, as the allocated budget of a correct slate can not exceed the allocated budget of the malicious slate.
In this case, the StandardFunding.executeStandard function will not execute the proposal, which is not included in the "malicious" proposal slate.
Impact
Standard proposals can be prevented from being funded in a distribution period.
Code Snippet
ecosystem-coordination/src/grants/base/StandardFunding.sol#L198-L219
198: for (uint i = 0; i < proposalIds_.length; ) {
199: // check if Proposal is in the topTenProposals list
200: if (_findProposalIndex(proposalIds_[i], topTenProposals[distributionId_]) == -1) return false;
201:
202: Proposal memory proposal = standardFundingProposals[proposalIds_[i]];
203:
204: // account for qvBudgetAllocated possibly being negative
205: if (proposal.qvBudgetAllocated < 0) return false;
206:
207: // update counters
208: sum += uint256(proposal.qvBudgetAllocated);
209: totalTokensRequested += proposal.tokensRequested;
210:
211: // check if slate of proposals exceeded budget constraint ( 90% of GBC )
212: if (totalTokensRequested > (gbc * 9 / 10)) {
213: return false;
214: }
215:
216: unchecked {
217: ++i;
218: }
219: }
Tool used
Manual Review
Recommendation
Consider checking for duplicate proposal ids in the checkSlate function.
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 checkSlate function does not verify that proposal IDs in the slate are unique, allowing duplicates to inflate the allocated budget.
Impact
Standard proposals can be prevented from being funded in a distribution period.
What the attacker needed
Ability to submit a proposal slate
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.
In this system, people propose projects to be funded, and a group of proposals is chosen together as a 'slate'. The code that checks a slate does not stop the same proposal from appearing many times. An attacker can make a slate full of one proposal, and because it uses up the budget, no other slate can beat it, so other proposals never get funded.
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.