Skip to content
DoS Audit finding Advanced

Tiers can be maintained active to give unfair advantage to user through DoS

A malicious actor can keep a high prize tier active by claiming a single prize from that tier at a loss, which prevents the tier from closing and stops bots from claiming prizes for other users. This gives the attacker an unfair advantage because their own bot will still claim their prizes, while other users may lose unclaimed prizes.

0x3e84fa45 Follow

Originally disclosed on Code4rena

Submitted by 0x3e84fa45

Tiers can be maintained active by claiming a single prize of the last tier at a loss. The protocol will close tiers of the next draw based on the largest tier claimed of the draw being closed, which is registered during the claiming of the prizes.

This is a symptom that liquidity is being spread too thin on the last tier, and is no longer profitable for bots to claim prizes for users since their gas costs are over the claiming fees they earn.

The closing of a tier is meant to increase maxFee, which is the highest price a claiming fee can achieve in the reverse Dutch Auction mechanism; which in the current draw, isn’t enough for the bot to be profitable.

The maxFee is computed based on the last active tier’s prize size, and by lowering the amount of tiers, the liquidity is going to get concentrated in less tiers and in less prizes (since the number of prizes is 4^tierNumber); thus, making the bots profitable again and incentivizing them to claim prizes for users.

During the draw where there are no incentives for bots to claim prizes, prizes won’t get claimed; which means that if someone won a high prize from a low tier, they would have to manually claim it. Otherwise, the liquidity of that prize will continue onto the next draw, leaving the user without a possibility of claiming their prize once the draw has passed.

A malicious actor that has deposited liquidity in the vaults that contribute to the prize pool could take advantage of this mechanic.

By having a bot that in this closing tier state claim their prizes when available and claim a single prize from the highest tier, they are able to maintain the tier active; which will cause following draws to fall again into the state where bots don’t claim prizes. This hugely decreases the probability of winning for users that don’t have a claiming bot while giving the malicious actor an unfair advantage.

Proof of Concept

Draw 0: closeDraw has just been executed and the remaining liquidity from the previous draw with the newly added liquidity for this draw computes a maxFee that isn’t enough to cover gas costs for bots to claim prizes. Therefore, the last tier is supposed to be closed. A malicious actor can claim a random single prize from the last tier at a loss to maintain the tier active, also claiming any prizes they may have won.

Draw 1: the new liquidity is added to the system, which will make the last tier’s prize size increase, and subsequently, the maxFee will increase. Depending on how much liquidity is added, maxFee will or won’t be enough for bots to start claiming prizes, since the last tier has accumulated the liquidity of two draws.

It could be the case that the added liquidity isn’t enough and creates a draw state similar to draw 0. To continue with the example, let’s assume that the accumulated liquidity of two draws computes a maxFee that is enough to incentivize bots to claim prizes.

Draw 1 behaves as expected, which means that the last tier’s liquidity would get claimed, and the following draw would rely mostly on the newly added liquidity. “Mostly” since there will be a remanent part of liquidity from the prizes that haven’t been won.

Draw 2: The situation of draw 0 repeats itself and the added liquidity on this draw is not concentrated enough to incentivize bots to claim prizes. The malicious actor claims a single prize at a loss again, to keep the tier active, also claiming any prizes they may have won.

This results in a situation where, depending on how much liquidity is added to each draw, many draws could result as inactive. Meaning, that unless users claim their own prizes, no one is going to claim them; while the malicious actor has an advantage, since their bot will claim their prizes, apart from maintaining the highest tier active.

Recommended Mitigation Steps

Change the mechanism by which largestTierClaimed is set, so that it’s resistant to a single user performing a claim.

Assessed type

DoS

asselstine (PoolTogether) confirmed

Picodes (judge) decreased severity to Medium and commented:

It seems to me that Medium severity is more appropriate here, as the profitability and the damage done by this attack scenario are hypothetical. It assumes that it is worth claiming prizes at a loss of, say maxFeePortionOfPrize * prize, to increase the attacker’s chances of winning. The damage is that users not claiming their prize (which requires multiple winners, as the attacker is claiming one price) will lose it.

PoolTogether mitigated:

Improved tier shrinking, retention, and expansion logic. PR: https://github.com/GenerationSoftware/pt-v5-prize-pool/pull/17

Status: Mitigation confirmed. Full details in reports from 0xStalin, dirk_y and rvierdiiev.


The original report as published on Code4rena, by 0x3e84fa45. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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

Impact

Users who do not claim their own prizes may lose them, while the attacker gains an unfair advantage; the judge noted the profitability and damage are hypothetical.

What the attacker needed

Attacker has deposited liquidity in the vaults; attacker runs a claiming bot; attacker is willing to claim at a loss

The fix

The mechanism for setting largestTierClaimed was changed to be resistant to a single user performing a claim, and the mitigation was confirmed.

How it was found

  1. Wait until a draw where the last tier is supposed to close because maxFee is too low for bots to claim prizes.
  2. Claim a single prize from the last tier at a loss to keep the tier active.
  3. Also claim any prizes the attacker has won.
  4. Repeat in subsequent draws when the same condition occurs.

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 prize system, prizes are grouped into tiers. When a tier is not profitable for bots to claim, it is supposed to close so that liquidity concentrates and claiming becomes worthwhile again. The report shows that one user can keep a tier open by claiming just one prize at a small loss, which stops the system from closing the tier and leaves other users without bots to claim their prizes.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by 0x3e84fa45

View all

4 more disclosed reports, best first.

More from PoolTogether

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.