#45478 [SC-Medium] Minting Cap Check Doesn't Include `poolFeeUBA` in `selfMint` and `mintFromUnderlying`

Submitted on May 15th 2025 at 09:21:14 UTC by @ni8mare for Audit Comp | Flare | FAssets

  • Report ID: #45478

  • Report Type: Smart Contract

  • Report severity: Medium

  • Target: https://github.com/flare-foundation/fassets/blob/main/docs/ImmunefiScope.md

  • Impacts:

    • Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield

    • Theft of unclaimed yield

Description

Brief/Intro

When executing selfMint or mintFromUnderlying operations, the checkMintingCap function is called but fails to account for the poolFeeUBA. This oversight results in an inaccurate cap verification process.

Vulnerability Details

Agent have an option to call selfMint and mintFromunderlying directly without collateral reservation to mint fAssets to their account. Following this path, the agent will only have to pay the pool fee.

https://github.com/flare-foundation/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/library/Minting.sol#L90

As shown on line 90, the minting cap is checked using only valueAMG without including the poolFeeUBA. This is problematic because the total minting will include the pool fee, as demonstrated in the _performMinting function, potentially exceeding the minting limit.

https://github.com/flare-foundation/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/library/Minting.sol#L205

The regular executeMinting function does not have this issue because the minting cap for mintingValue+fee is already checked during the collateral reservation process, as shown in the code below.

https://github.com/flare-foundation/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/library/CollateralReservations.sol#L269

Impact Details

The minting cap can be exceeded, compromising the integrity of the system's economic constraints. Over-minting can lead to inflation of the fAsset, reducing its value and leading to a loss for the existing user. These additional minted fAssets can then be redeemed by an attacker, extracting value from the system and thus eating into the funds of other users.

References

https://github.com/flare-foundation/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/library/Minting.sol#L90

https://github.com/flare-foundation/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/library/Minting.sol#L205

Proof of Concept

Proof of Concept

  • Assume the minting cap is set to 100 (equivalent to 10 lots)

  • An agent calls selfMint with 10 lots, where each lot represents 10 assets, totalling 100 assets

  • The agent is required to pay 10 additional assets as a pool fee

  • The function calls checkMintingCap(100), which passes verification

  • As a result, 110 fAssets are minted, exceeding the established minting cap of 100

Was this helpful?