Skip to content
Business logic Audit finding Intermediate

Maxmint overstates the executable mint limit after exchange rate changes

The vault's maxMint quote is calculated from the deposit limit rather than the remaining asset capacity, so after an exchange-rate change it can advertise a share amount whose actual cost exceeds the limit. An integration that mints the advertised maximum then reverts with a deposit-limit error, causing availability failures rather than any loss of funds.

qed Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

88834 sc low maxmint overstates the executable mint limit after exchange rate changes

Submitted on Aug 15th 2026 at 05:51:28 UTC by @QED for Audit Comp | Firelight

Description

Brief/Intro

FirelightVault can return a positive ERC-4626 maxMint quote whose exact share amount cannot fit within the remaining asset capacity, causing compliant integrations to submit reverting mints.

Vulnerability Details

Affected target: FirelightVault at commit 42f9ea5e43d88b35197b901acc2a8c24b314fa62

Severity: Low

Asset: contracts/core/FirelightVault.sol

Root Cause

maxMint computes convertToShares(depositLimit) - totalSupply() instead of deriving the executable share amount from remaining asset capacity. The vault's virtual-asset/share conversion is not additive, while mint ceil-rounds the asset cost and _depositFunds rejects the resulting total when it exceeds depositLimit.

Attack Path

{% stepper %} {% step %}

Deposit one asset

A depositor deposits one asset and receives one share. {% endstep %}

{% step %}

Transfer an additional asset to the vault

Any underlying holder directly transfers one more asset to the vault, changing the state to one share backed by two assets under a three-asset limit. {% endstep %}

{% step %}

Read the maximum mint quote

An ERC-4626 integration reads maxMint(receiver) = 1. {% endstep %}

{% step %}

Preview the mint

previewMint(1) ceil-rounds the cost to two assets, although only one asset of capacity remains. {% endstep %}

{% step %}

Attempt to mint

The integration calls mint(1, receiver), and the cap check reverts with DepositLimitExceeded. {% endstep %} {% endstepper %}

Impact Details

ERC-4626 routers, allocators, frontends, and batched transactions can suffer reliable availability failures when they mint the advertised maximum after exchange-rate changes, but the defect does not enable theft or bypass the deposit limit.

References

Recommended Fix

Compute maxMint from remaining asset capacity with mint-equivalent rounding and enforce with regression tests that previewMint(maxMint(receiver)) <= maxDeposit(receiver) across exchange-rate changes.

Link to Proof of Concept

https://gist.github.com/w-qedaudit/b8c9f3d72bf1c47f73955da7adaf1ed2

Proof of Concept

PoC gist: https://gist.github.com/w-qedaudit/b8c9f3d72bf1c47f73955da7adaf1ed2

Prerequisite: Git, Node.js, and npm must be installed with network access available for cloning and dependency installation.

The supplied poc.js is a temporary focused reproducer copied into the checked-out repository at runtime; it is not an in-tree project test or modification.

Shell
cd firelight/igtok1p3-maxmint-unexecutable
chmod +x run.sh
./run.sh

Expected successful output includes:

STATE totalSupply=1 totalAssets=2 depositLimit=3
QUOTE maxDeposit=1 maxMint=1 previewMint(maxMint)=2
RESULT mint(maxMint) reverted error=DepositLimitExceeded
POST totalSupply=1 totalAssets=2

The complete output from the verified execution is included in poc_output.txt.

The original report as published on Immunefi, by QED. 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 maxMint derives the share amount from the deposit limit minus total supply, while the conversion is not additive and mint ceil-rounds the asset cost, so the quoted amount can cost more than the remaining capacity.

Impact

Integrations that mint the advertised maximum after exchange-rate changes can hit reliable availability failures, but the defect does not enable theft or bypass the deposit limit.

What the attacker needed

ERC-4626 integration trusts maxMint; exchange rate has changed via direct transfer

The fix

maxMint should be computed from the remaining asset capacity using the same rounding as mint, with regression tests that the previewed cost of the quoted maximum never exceeds the maximum deposit.

How it was found

  1. Deposit one asset to receive one share.
  2. Transfer one more asset directly to the vault, so one share is backed by two assets under a three-asset limit.
  3. Read maxMint for the receiver, which returns one.
  4. Preview the mint of one share, which ceil-rounds the cost to two assets although only one asset of capacity remains.
  5. Attempt the mint, which reverts with a deposit-limit error.

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 vault lets people deposit an asset and get shares in return. It also publishes a figure saying how many shares you can still mint, and other software trusts that figure. Here the figure was worked out in a way that ignored rounding, so following it led to a transaction that the vault itself rejected.

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 qed

View all

13 more disclosed reports, best first.

More from Firelight

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.