Skip to content
Business logic Audit finding Intermediate

Pools can be created without initial liquidity

The protocol intended to prevent public pool creation without initial liquidity, but an attacker could use a flash loan to temporarily provide the required liquidity, create the pool, receive LP tokens, and then withdraw the liquidity. This allowed bypassing the intended restriction.

cmichel Follow

Originally disclosed on Code4rena

Submitted by cmichel

The protocol differentiates between public pool creations and private ones (starting without liquidity). However, this is not effective as anyone can just flashloan the required initial pool liquidity, call PoolFactory.createPoolADD, receive the LP tokens in addForMember and withdraw liquidity again.

Recommend considering burning some initial LP tokens or taking a pool creation fee instead.

SamusElderg (Spartan) confirmed:

Whilst we were aware of this (more of a deterrent than prevention) contributors have discussed some methods of locking this liquidity in and making it at least flash loan resistant. For instance, a withdraw-lock (global by pool) for 7 days after the pool’s genesis so that no user can withdraw liquidity until 7 days have passed. There are other ideas floating around too; but regardless this issue will be addressed in some way prior to launch

The original report as published on Code4rena, by cmichel. 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 pool creation process only checked that liquidity was present at the moment of creation, without preventing its immediate withdrawal, so a flash loan could satisfy the requirement temporarily.

What the attacker needed

Ability to take a flash loan; access to the pool creation function

The fix

The report recommends burning some initial LP tokens or charging a pool creation fee; the project acknowledged the issue and planned to address it before launch.

How it was found

  1. Obtain the required initial pool liquidity via a flash loan.
  2. Call PoolFactory.createPoolADD to create the pool.
  3. Receive the LP tokens in addForMember.
  4. Withdraw the liquidity again.

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.

A flash loan is a loan that must be borrowed and repaid within the same transaction. The protocol wanted to stop people from creating pools without putting up their own money, but someone could borrow the needed funds temporarily, create the pool, get the pool's tokens, and then take the money back. This meant the rule was not actually enforced.

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 cmichel

View all

196 more disclosed reports, best first.

More from Spartan Protocol Contest

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.