Skip to content
Business logic Audit finding Intermediate

Lack of freeze authority check for collateral tokens on create trading pool

The protocol does not check whether a collateral SPL token has an active freeze authority. If the authority freezes the pool's token account, borrowing or repaying can be blocked and funds locked.

Koolex Follow

Originally disclosed on Code4rena

Submitted by Koolex

SPL tokens are used as collateral in the protocol. On borrow, there is a transfer from the borrower into a PDA (position account). On repay, the other way around.

However, SPL token could have a freeze authority. Therefore, any account is vulnerable to be frozen. This could be harmful for both borrowers and lenders. I believe, The protocol should be resilient enough to not fall into such situations where the funds are locked and borrowing or repaying are DoSed.

Proof of Concept

There is no check for freeze authority of the mint (i.e. token).

More info on freeze authority feature:

The Mint may also contain a freeze_authority which can be used to issue FreezeAccount instructions that will render an Account unusable. Token instructions that include a frozen account will fail until the Account is thawed using the ThawAccount instruction. The SetAuthority instruction can be used to change a Mint’s freeze_authority. If a Mint’s freeze_authority is set to None then account freezing and thawing is permanently disabled and all currently frozen accounts will also stay frozen permanently.

SPL Token#freezing-accounts

Recommended Mitigation Steps

Ensure the collateral token does not have an active freeze_authority. If the freeze_authority was set to None, then freezing feature can never work again.

Assessed type

Access Control

piske-alex (Lavarage) confirmed

alcueca (judge) commented:

Even given that this will be an exceedingly rare event, there will be losses to innocent users if the account of a trading pool becomes frozen. Given that this is an avoidable issue, the severity stays as Medium.


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

The pool creation logic does not verify that the collateral mint's freeze authority is disabled.

Impact

If the freeze authority freezes the pool's token account, borrowing and repaying are blocked and funds could be locked, though the judge notes this is an exceedingly rare event.

What the attacker needed

Collateral token has an active freeze authority; freeze authority freezes the pool account

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.

Some tokens on Solana can be frozen by a special admin key, which makes the token account unusable. This protocol accepts such tokens as collateral without checking, so if the admin freezes the pool's account, users cannot borrow or repay and their funds are stuck.

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 Koolex

View all

10 more disclosed reports, best first.

More from Lavarage Invitational

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.