High Prizes might not be claimed
The claimer fee was capped by the minimum prize size rather than the actual prize size, so when gas costs exceeded that minimum, solvers had no incentive to claim large prizes. As a result, high prizes could go unclaimed, causing a loss of reputation for the protocol.
markus_ether Follow with josephdara
Originally disclosed on Code4rena
Submitted by markus_ether, also found by josephdara
Lines of code
https://github.com/GenerationSoftware/pt-v5-claimer/blob/57a381aef690a27c9198f4340747155a71cae753/src/Claimer.sol#L210 https://github.com/GenerationSoftware/pt-v5-claimer/blob/57a381aef690a27c9198f4340747155a71cae753/src/Claimer.sol#L173
Impact
PoolTogether V5 delegates the task of claiming the prizes to a network of Claimers that are incentivized to claim prizes for a share of the prize won. The fees the Claimant receives is calculated based on a Dutch Auction, but then limited by the minimum prize of the prize pool.
fee = min (fee in auction = % maxFeePortionOfPrize * minPrize).
When the gas costs exceed the minPrize, the solver has no incentives to claim the price. Notice that the number of prizes only adjusts after very few prizes are claimed.
Proof of Concept
Gas prices will then rise well above the minPrize. The highest prize is suddenly drawn that day. The solvers have no incentive to claim the prize and the winner does not monitor the contract. As a result, no one claims the top prize. The protocol suffers a loss of reputation.
Tools Used
VS Code
Recommended Mitigation Steps
The problem is that the incentives are not exactly aligned. The user is willing to pay anything up to their price to receive their price. But the maximum the solver receives is the minimum price. We can align the two incentives by using each user’s price as an upper bound.
function _computeMaxFee(uint8 _tier, uint8 _numTiers) internal view returns (uint256) {
uint8 _canaryTier = _numTiers - 1;
if (_tier != _canaryTier) {
// canary tier
- return _computeMaxFee(prizePool.getTierPrizeSize(_canaryTier - 1));
+ return _computeMaxFee(prizePool.getTierPrizeSize(_tier));
} else {
return _computeMaxFee(prizePool.getTierPrizeSize(_canaryTier));
}
}
Since we already validate the inputs in claimPrize, the attacker can not claim more than the prize is worth.
asselstine (PoolTogether) confirmed
Made
maxFeea function of the tier’s prize size, not the smallest prize size. PR: https://github.com/GenerationSoftware/pt-v5-claimer/pull/7
Status: Mitigation error. Full details in report from dirk_y, and in the Mitigation Review section below.
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 maximum fee a solver could receive was based on the smallest prize size instead of the actual prize size, so incentives did not scale with larger prizes.
Impact
High-value prizes could remain unclaimed when gas costs exceeded the minimum prize, damaging the protocol's reputation.
What the attacker needed
Gas costs exceed minimum prize; solvers act rationally; winner does not claim manually
The fix
The fee cap should be based on the actual prize size for the tier, not the smallest prize size; this was mitigated but the mitigation contained an error.
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 called solvers are paid a fee to claim prizes on behalf of winners. The fee was limited to a small fixed amount, so if the cost of processing the claim was higher than that fee, solvers would not bother. This meant big prizes could be left unclaimed.
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.