Skip to content
Business logic Audit finding Beginner

Cannot use a pool token suffix of MAX_SUFFIX_LEN

A length check in the agent vault creation code used a strict less-than comparison, so a pool token suffix of exactly the maximum allowed length was rejected. An agent owner could not create a vault with a suffix of the intended maximum length, and the call reverted.

Oxgritty Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#46266 [SC-Insight] Cannot use a pool token suffix of MAX_SUFFIX_LEN

Submitted on May 27th 2025 at 14:47:51 UTC by @Oxgritty for Audit Comp | Flare | FAssets

Description

Brief/Intro

  • When agent owner wants to create a vault, along with other parameters he also has to provide poolTokenSuffix, now the intended behaviour is that, its maximum length can be of MAX_SUFFIX_LEN but due to a logical error, agent owner can only provide a poolTokenSuffix of max length MAX_SUFFIX_LEN - 1.

Vulnerability Details

  • For creating an agent createAgentVault function is called along with certain parameters of type AgentSettings.Data calldata _settings, inside _settings there is one parameter called _settings.poolTokenSuffix, now its max length can be of MAX_SUFFIX_LEN, but due the use of < instead of <=, its maximum allowed length is MAX_SUFFIX_LEN - 1.

Impact Details

  • The maximum length allowed for poolTokenSuffix will be MAX_SUFFIX_LEN - 1, which is 1 less than the intended length.

References

Proof of Concept

Proof of Concept

  1. Agent owner calls createAgentVault with _settings and length of _settings.poolTokenSuffix is equal to MAX_SUFFIX_LEN.
  2. The code will revert in _reserveAndValidatePoolTokenSuffix due to following check:
Solidity
        require(len < MAX_SUFFIX_LEN, "suffix too long");

The original report as published on Immunefi, by Oxgritty. 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 an off-by-one error: the length check uses a strict less-than comparison against the maximum instead of less-than-or-equal.

Impact

The maximum usable suffix length is one character shorter than intended, so vault creation with a maximum-length suffix fails.

What the attacker needed

Agent owner role

The fix

The length check should use less-than-or-equal so a suffix of exactly the maximum length is accepted.

How it was found

  1. Agent owner calls createAgentVault with settings whose pool token suffix length equals the maximum.
  2. The call reverts in the suffix validation because the length check rejects the maximum value.

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 someone creates a vault, they pick a short label called a suffix. The code is meant to allow labels up to a set maximum length, but it checks the length with a rule that rejects anything equal to that maximum. So a label of exactly the allowed size fails, even though it should work.

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 Oxgritty

View all

5 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.