Skip to content
Business logic Audit finding Intermediate

Malicious Agent could repeatedly create and destroy vaults reserving different suffixes and grief other agents

A whitelisted agent can create vaults with chosen pool token suffixes, which are permanently reserved even after the vault is destroyed. An attacker can repeatedly create and destroy vaults to reserve many suffixes at only gas cost, preventing legitimate agents from using them.

avoloder Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#45336 [SC-Low] Malicious Agent could repeatedly create and destroy vaults reserving different suffixes and grief other agents

Submitted on May 12th 2025 at 20:00:55 UTC by @avoloder for Audit Comp | Flare | FAssets

Description

Brief/Intro

A malicious agent, once whitelisted could create multiple vaults just to reserve different suffixes, so that other users cannot use them

Vulnerability Details

During the creation of agent vaults, user provides agent settings, among which is also poolTokenSuffix. During the vault creation (as part of the createAgentVault() function), this poolTokenSuffix gets validated and reserved by saving it in the mapping reservedPoolTokenSuffixes. Before being saved, it is checked if the suffix is already present in the mapping and only saved if it's not.

User can also destroy the vault at any time. However, the mapping reservedPoolTokenSuffixes is never updated, i.e., the suffix remains active. This way, a malicious user, could repeatedly create vaults, reserve different suffixes (for different tokens, different combinations) and therefore prevent other legitimate agents to choose suffix they want. User could then destroy the vault and get back all his funds, so the only costs of the attack are gas costs.

Impact Details

The impact is griefing -> causing harm to legit users (agents) by reserving different suffixes at almost no cost.

References

https://github.com/flare-labs-ltd/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/library/AgentsCreateDestroy.sol#L59-L121 https://github.com/flare-labs-ltd/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/library/AgentsCreateDestroy.sol#L239-L256 https://github.com/flare-labs-ltd/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/library/AgentsCreateDestroy.sol#L145-L176

Proof of Concept

Proof of Concept

Run this test as part of the Agents.ts

it("can reserve multiple suffixes by creating and destroying vault", async () => {
        const suffix = "SUFFX1";

        assert.isFalse(await assetManager.isPoolTokenSuffixReserved(suffix));
        const agentVault = await createAgent(agentOwner1, underlyingAgent1, { poolTokenSuffix: suffix });

        // announce destroy agent
        await assetManager.announceDestroyAgent(agentVault.address, { from: agentOwner1 });
        await deterministicTimeIncrease(300);

        const tx = await assetManager.destroyAgent(agentVault.address, agentOwner1, { from: agentOwner1 });
        assert.isTrue(await assetManager.isPoolTokenSuffixReserved(suffix));
        await expectRevert(createAgent(agentOwner1, "Agent2", { poolTokenSuffix: suffix }), "suffix already reserved");
    })

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

The mapping of reserved pool token suffixes is never cleared when an agent vault is destroyed, so suffixes remain reserved permanently.

Impact

Legitimate agents could be prevented from choosing their desired pool token suffixes, causing griefing at only gas cost.

What the attacker needed

Attacker is a whitelisted agent; gas costs only

How it was found

  1. Create an agent vault with a chosen pool token suffix.
  2. Announce destruction of the vault and wait the required time.
  3. Destroy the vault, which returns the funds but leaves the suffix reserved.
  4. Repeat with other suffixes to reserve them all.

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.

When an agent creates a vault, they pick a short name ending (a suffix) for a token. The system remembers that suffix forever, even if the vault is later deleted. A bad actor can therefore grab many suffixes and throw away the vaults, blocking others from using those names.

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 avoloder

View all

10 more disclosed reports, best first.

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.