ReraiseETHCrowdfund#claimMultiple can be used to grief large depositors
The claimMultiple function allows any user to mint NFTs for another contributor, and the caller can specify how the voting power is split into multiple NFTs. An attacker can force a large depositor to receive many small NFTs instead of one large NFT, greatly increasing the victim's future gas costs.
Submitted by 0x52
User can be grieved by being force minted a large number of NFTs with low voting power instead of one with high voting power.
Proof of Concept
ReraiseETHCrowdfund.sol#L354-L377
for (uint256 i; i < votingPowerByCard.length; ++i) {
if (votingPowerByCard[i] == 0) continue;
uint96 contribution = (votingPowerByCard[i] * 1e4) / exchangeRateBps;
if (contribution < minContribution_) {
revert BelowMinimumContributionsError(contribution, minContribution_);
}
if (contribution > maxContribution_) {
revert AboveMaximumContributionsError(contribution, maxContribution_);
}
votingPower -= votingPowerByCard[i];
// Mint contributor a new party card.
uint256 tokenId = party.mint(contributor, votingPowerByCard[i], delegate);
emit Claimed(contributor, tokenId, votingPowerByCard[i]);
}
ReraiseETHCrowdfund#claimMultiple can be called by any user for any other user. The above loop uses the user specified votingPowerByCard to assign each token a voting power and mint them to the contributor. This is problematic because large contributors can have their voting power fragmented into a large number of NFTs which a small amount of voting power each. The dramatically inflates the gas costs of the affected user.
Example:
minContribution = 1 and maxContribution = 100. User A contributes 100. This means they should qualify for one NFT of the largest size. However instead they can be minted 100 NFTs with 1 vote each.
Recommended Mitigation Steps
If msg.sender isn’t contributor it should force the user to mint the minimum possible number of NFTs:
uint256 votingPower = pendingVotingPower[contributor];
if (votingPower == 0) return;
+ if (msg.sender != contributor) {
+ require(votingPowerByCard.length == (((votingPower - 1)/maxContribution) + 1));
+ }
Looking forward to sponsor comment on this one, I do see the potential issue.
0xble (Party) confirmed and commented:
To give more context, the reason we allow minting/claiming on another’s behalf is to allow others to potentially unblock governance if a user with delegated voting power does not come to claim, so it is an important feature to enable. It also works this way in prior releases of the protocol with past crowdfunds.
This is a valid concern though and I like the recommended mitigation.
We’ve decided to refactor the way claiming works in the
ReraiseETHCrowdfund, partially because a large number of findings like this being submitted around that one area that highlighted for us the need to rework its logic.The change will make it so (1) crowdfund NFTs are minted per contribution instead of per address and (2) claiming works more like a 1:1 conversion of your crowdfund NFT into a party card instead of how it works now. In the future we will also add the ability to split/merge party cards.
This should mitigate this finding because in this new system you cannot decide how to allocate another person’s voting power when claiming for them, there is only one choice which is to convert their crowdfund NFT into a party card of equivalent voting power.
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
The claimMultiple function lets the caller freely choose the array of voting power amounts per NFT when claiming on behalf of another user, without restricting the number of NFTs to the minimum needed.
Impact
The victim's gas costs are dramatically inflated because they must manage many NFTs instead of one, though the total voting power remains the same.
What the attacker needed
Victim has a large pending contribution; attacker can call claimMultiple for the victim
The fix
The project refactored claiming so that NFTs are minted per contribution and claiming converts a crowdfund NFT 1:1 into a party card, preventing callers from choosing how to split another user's voting power.
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, when someone contributes funds, they later claim NFTs that represent their voting power. Normally a large contribution would become one big NFT. But because anyone can trigger the claim for someone else and choose how to split the voting power, an attacker can make the victim receive many tiny NFTs instead. Each NFT costs gas to manage later, so the victim ends up paying much more.
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.