Skip to content
Access control Audit finding Intermediate

Anyone can curate pools and steal rewards

The Router.curatePool and replacePool functions lack access control, allowing anyone to curate pools. An attacker could use a flash loan to replace existing curated pools with their own, thereby redirecting rewards to a custom token pool and gaming the reward system.

Vader Protocol contest

Originally disclosed on Code4rena

The Router.curatePool and replacePool don’t have any access restriction. An attacker can get a flash loan of base tokens and replace existing curated pools with their own curated pools.

Curated pools determine if a pool receives rewards. An attacker can remove rewards of a curated pool this way and add rewards to their own pool with a custom token they control. They can then go ahead and game the reward system by repeatedly swapping in their custom pool with useless tokens, withdraw liquidity, and in the end, pay back the base flashloan.

Recommend preventing the replacing of curations through flash loans. Also, consider making pool curations DAO-exclusive actions.

strictly-scarce (vader) disputed:

Slip-based pools cannot be attacked with flash loans.

dmvt (judge) commented:

Further comment from @cmichelio:

I can curate my custom token using curatePool without using a flashloan or using replacePool by temporarily providing liquidity to the pool without trading in it and getting slip-fee’d. I’m not trading in the pool, and don’t think providing/removing liquidity comes with a fee. I think this is still an issue.

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

Root cause

Likely, the curatePool and replacePool functions lack any access control, allowing any user to change pool curations.

Impact

An attacker could steal rewards by redirecting them to their own pool, though the exploit may be limited if slip-based pools prevent flash loan attacks.

What the attacker needed

Access to flash loan; ability to call curatePool or replacePool

The fix

The functions should be restricted, for example by making pool curations DAO-exclusive actions.

How it was found

  1. Obtain a flash loan of base tokens.
  2. Use the flash loan to replace existing curated pools with a custom pool.
  3. Repeatedly swap in the custom pool with useless tokens to earn rewards.
  4. Withdraw liquidity and repay the flash loan.

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, 'curated pools' are special pools that earn rewards. The functions to curate a pool are open to anyone, so an attacker can use a flash loan (a loan that is borrowed and repaid in the same transaction) to temporarily gain enough tokens to replace the existing curated pools with their own. Then they can earn rewards on their own pool with a worthless token and keep the rewards.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from Vader Protocol contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.