Prize winners can set claim hooks to revert claimPrize from others to save the claim rewards.
Summary
Prize winners can set claim hooks to revert claimPrize from others, and then they claimPrize themselves with 0 claim reward. Winners have the incentive to do so as this will save the claim reward. However, this will discourage other normal claimers to claim prizes.
Vulnerability Detail
The Prize Claimer contract allows anyone to claim prizes on behalf of winners, and earn rewards in doing so. The calling path to claim prizes is Claimer.claimPrizes => Claimer._claim => Claimable.claimPrize => PrizePool.claimPrize. Claimer.claimPrizes will calculate the claim rewards and the rewards will be added to the claim reward recipient's account (L563). Note that the claim rewards are paid out of the winner's prize (L566), then the remaining prize is transferd to the _prizeRecipient (L590).
Each account is allowed to set claim hooks that can be called when they win. The hooks are called in Claimable.claimPrize, before or after PrizePool.claimPrize. In such case, a winner can set an after claim hook, and the hook reverts the claimPrize if the claim reward (i.e. _reward) is not 0. The winner listens for this revert event, and then calls Claimer.claimPrizes himself to claim his own prize with 0 claim reward. In such case, the winner can save the claim reward, and gains the total prize.
Winners have the incentive to do so as this will save the claim reward. However, this will discourage other normal claimers to claim prizes.
Impact
Winners can set claim hook to revert others' claimPrize to save claim rewards. This discourages other normal claimers to claim prizes. The worst case scenario is that the incentive mechanism may be destroyed.
ydlee
medium
Prize winners can set claim hooks to revert
claimPrize
from others to save the claim rewards.Summary
Prize winners can set claim hooks to revert
claimPrize
from others, and then theyclaimPrize
themselves with 0 claim reward. Winners have the incentive to do so as this will save the claim reward. However, this will discourage other normal claimers to claim prizes.Vulnerability Detail
The Prize Claimer contract allows anyone to claim prizes on behalf of winners, and earn rewards in doing so. The calling path to claim prizes is
Claimer.claimPrizes => Claimer._claim => Claimable.claimPrize => PrizePool.claimPrize
.Claimer.claimPrizes
will calculate the claim rewards and the rewards will be added to the claim reward recipient's account (L563). Note that the claim rewards are paid out of the winner's prize (L566), then the remaining prize is transferd to the_prizeRecipient
(L590).https://github.com/sherlock-audit/2024-05-pooltogether/blob/main/pt-v5-prize-pool/src/PrizePool.sol#L560-L591
Each account is allowed to set claim hooks that can be called when they win. The hooks are called in
Claimable.claimPrize
, before or afterPrizePool.claimPrize
. In such case, a winner can set an after claim hook, and the hook reverts theclaimPrize
if the claim reward (i.e._reward
) is not 0. The winner listens for this revert event, and then callsClaimer.claimPrizes
himself to claim his own prize with 0 claim reward. In such case, the winner can save the claim reward, and gains the total prize.https://github.com/sherlock-audit/2024-05-pooltogether/blob/main/pt-v5-vault/src/abstract/Claimable.sol#L100-L118
Winners have the incentive to do so as this will save the claim reward. However, this will discourage other normal claimers to claim prizes.
Impact
Winners can set claim hook to revert others'
claimPrize
to save claim rewards. This discourages other normal claimers to claim prizes. The worst case scenario is that the incentive mechanism may be destroyed.Code Snippet
https://github.com/sherlock-audit/2024-05-pooltogether/blob/main/pt-v5-prize-pool/src/PrizePool.sol#L560-L591
https://github.com/sherlock-audit/2024-05-pooltogether/blob/main/pt-v5-vault/src/abstract/Claimable.sol#L100-L118
Tool used
Manual Review
Recommendation
Due to the presence of claim hooks, I am unable to devise a good solution to this problem. Perhaps removing the claim hooks could be considered.
Duplicate of #73