Inconsistent behavior for canary claims in the claimer
The claimer contract calculates fees per claim using only the standard prize pool claim count, ignoring canary claims. This inconsistency could lead to incorrect fee calculations for canary claims.
Submitted by volodya
Proof of Concept
Whenever a claimer claims prizes they compute fees per claim without considering canary claims.
function claimPrizes(
Vault vault,
uint8 tier,
address[] calldata winners,
uint32[][] calldata prizeIndices,
address _feeRecipient
) external returns (uint256 totalFees) {
uint256 claimCount;
for (uint i = 0; i < winners.length; i++) {
claimCount += prizeIndices[i].length;
}
uint96 feePerClaim = uint96(
_computeFeePerClaim(
_computeMaxFee(tier, prizePool.numberOfTiers()),
claimCount,
prizePool.claimCount()
)
);
vault.claimPrizes(tier, winners, prizeIndices, feePerClaim, _feeRecipient);
return feePerClaim * claimCount;
}
Recommended Mitigation Steps
Consider canary as a claim.
uint96 feePerClaim = uint96(
_computeFeePerClaim(
_computeMaxFee(tier, prizePool.numberOfTiers()),
claimCount,
- prizePool.claimCount()
+ prizePool.claimCount() + prizePool.canaryClaimCount()
)
);
Assessed type
Error
asselstine (PoolTogether) confirmed
Unified standard and canary tier. PR: https://github.com/GenerationSoftware/pt-v5-prize-pool/pull/17
Status: Mitigation confirmed. Full details in report from rvierdiiev, dirk_y and 0xStalin.
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 fee calculation uses only the standard claim count and omits the canary claim count, causing inconsistent fee computation.
Impact
The fee per claim may be calculated incorrectly for canary claims, potentially leading to over- or under-charging of fees.
What the attacker needed
None
The fix
The fee calculation should include the canary claim count by adding `prizePool.canaryClaimCount()` to the claim count.
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 smart contract that pays out prizes calculates a fee for each claim based on how many claims have been made. It forgot to include a special type of claim called a canary claim, so the fee might be wrong for those.
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.