Skip to content
Business logic Audit finding Intermediate

Claimer.claimPrizes can be front-runned in order to make losses for the claim bot

rvierdiiev Follow with MiniGlome

Originally disclosed on Code4rena

Submitted by rvierdiiev, also found by MiniGlome

Proof of Concept

All prizes in the system should be claimed during the draw period. Anyone can call the claimPrizes function for any winner and prize. But the idea of protocol is to incentivize claim bots to do all claims instead of users. These should benefit from batching claims together in 1 call.

Also the Claimer contract is using vrgda which can increase/decrease fee for the claimer, depending of amount of already claimed prizes. That actually means, that in case not enough prizes are claimed in some point of time, then the fee will be increased to incentivize more bots.

So as bots will try to batch a lot of prize claims together, that means that they will spent a lot on gas. A malicious actor can see which prizes the bot is going to claim and front-run them with the last prize in the list. As a result, claiming will fail and the bot will face losses.

Another reason why a malicious actor can do that is to make vrgda to provide bigger fees. They can create a bot that will block claims of other bots with a big amount of claims in the batch, in order to wait and get better prices and claim those prize by themself and receive fees.

Tools Used

VsCode

Recommended Mitigation Steps

In the case of if a price is already claimed, then you can return early from the PrizePool.claimPrize function and emit some event. In this case, bots will not receive fee for the already claimed prize and their tx will continue with other prizes in the batch.

Assessed type

Error

asselstine (PoolTogether) confirmed

Picodes (judge) commented:

I’ll keep medium severity, as the sponsor confirmed with their label that it was valuable to them. I think we could also justify this being low. As in such cases, it is up to the bot to use a private rpc or some other solution to avoid being front-ran.

PoolTogether mitigated:

Added minVrgdaFee and allowed silent failure of claims. PRs: https://github.com/GenerationSoftware/pt-v5-claimer/pull/8 https://github.com/GenerationSoftware/pt-v5-vault/pull/22 https://github.com/GenerationSoftware/pt-v5-prize-pool/pull/23

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


The original report as published on Code4rena, by rvierdiiev. 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.

What is known

A medium-severity business logic bug in PoolTogether. Code4rena made it public on 27 September 2023. Found in the 2023-07-pooltogether audit contest (finding M-24), also found by 1 other warden.

About Business logic

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

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.

More by rvierdiiev

View all

72 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.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.