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.
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_authoritywhich can be used to issueFreezeAccountinstructions that will render an Account unusable. Token instructions that include a frozen account will fail until the Account is thawed using theThawAccountinstruction. TheSetAuthorityinstruction can be used to change a Mint’sfreeze_authority. If a Mint’sfreeze_authorityis set toNonethen account freezing and thawing is permanently disabled and all currently frozen accounts will also stay frozen permanently.
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
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.
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.