Skip to content
Business logic Audit finding Intermediate

Last user may exit with almost all of his values, but he'll purposefully leave a small 1e18 or a little more to grief destroy()

An agent that announces destruction of its collateral pool can be blocked by anyone who deposits the minimum amount into the pool, because destruction requires the pool to be empty. The attacker spends only a tiny amount of the native token to permanently prevent the agent and pool from being destroyed.

onthehunt Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#46924 [SC-Low] Last user may exit with almost all of his values, but he'll purposefully leave a small 1e18 or a little more to grief `destroy()`

Submitted on Jun 6th 2025 at 08:56:36 UTC by @onthehunt for Audit Comp | Flare | FAssets

Description

Brief/Intro

CollateralPool::destroy() is used to remove destroy an agent and collateral pool, but he may be griefed from that for a very small amount.

Vulnerability Details

Let's say that agent wants to remove himself from the protocol for some reason and announce destroy via announceDestroyAgent(), which will make destroying the agent possible after the specified settings.withdrawalWaitMinSeconds

Nothing is left inside the pool and he successfully calls the aforementioned function.

But a malicious user spots that and decides to call CollateralPool.enter(), with the smaller amount available, which will be no more than a couple of bucks, if not less.

MIN_NAT = 1e18 which is 1e18 of flare native token, costing literal cents.

Via that, a user can block the destruction of an agent and its collateral pool for as I said, a very small amount and accessible amount of money, thus preventing the whole action.

Impact Details

Agent and its collateral pool will never be destroyed, leaving broken functionality the reason of the bug, as we should be able to do so after announcing it, leaving the users responsible for their action (we should just destroy the pool even if there is something left, as the announcement starts only if there's nothing in the pool).

References

https://github.com/flare-labs-ltd/fassets/blob/main/contracts/assetManager/implementation/CollateralPool.sol#L833

https://github.com/flare-labs-ltd/fassets/blob/main/contracts/assetManager/library/AgentsCreateDestroy.sol#L145-L176

https://github.com/flare-labs-ltd/fassets/blob/main/contracts/assetManager/library/AgentsCreateDestroy.sol#L134

Proof of Concept

  1. Agent wants to destroy himself and the collateral pool as they are empty and calls announceDestroyAgent()
  2. Alice sees that and calls CollateralPool::enter() with the smallest value she can enter the pool
  3. The time passes that makes destroying the pool possible, but the agent has been griefed by Alice and can't do that

The original report as published on Immunefi, by onthehunt. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

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 destroy routine requires the pool balance to be zero, so any third party can keep it non-zero with a minimal deposit and block destruction indefinitely.

Impact

The agent and its collateral pool may never be destroyed, leaving broken functionality, at a cost of only a few cents to the attacker.

What the attacker needed

Agent has announced destruction; attacker can pay the minimum deposit

The fix

The destroy logic should not depend on the pool being empty, or should allow the announced destruction to proceed regardless of a small residual balance.

How it was found

  1. The agent announces destruction of the empty collateral pool.
  2. An attacker calls the pool's enter function with the smallest allowed amount.
  3. The waiting period passes, but the pool is no longer empty, so destruction cannot proceed.

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 collateral pool is a contract that holds money an agent has put up as a guarantee. The protocol lets an agent announce that it wants to close the pool, and after a waiting period the pool can be destroyed, but only if it is empty. Here someone can put in the smallest allowed deposit, which is worth only cents, and that stops the pool from ever being empty, so the destruction never happens.

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 from Flare | FAssets

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.