Skip to content
Business logic Audit finding Intermediate

Minter's underlying token can get stuck if the agent calls mintingDefault before the minter’s transaction is recorded on the underlying blockchain.

The minter's underlying token can become permanently stuck if the agent calls mintingPaymentDefault before the minter's transaction is confirmed on the underlying blockchain. This occurs when the transaction remains in the mempool beyond the payment deadline, even though the network continues to advance.

ni8mare Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#45864 [SC-Insight] Minter's underlying token can get stuck if the agent calls mintingDefault before the minter’s transaction is recorded on the underlying blockchain.

Submitted on May 21st 2025 at 16:16:19 UTC by @ni8mare for Audit Comp | Flare | FAssets

Description

Brief/Intro

The minter’s underlying asset can become permanently stuck if the agent invokes mintingPaymentDefault before the minter’s transaction is confirmed on the underlying blockchain. This issue arises when the transaction remains in the mempool beyond the payment deadline, even though the network continues to advance in terms of block number and timestamp.

Vulnerability Details

Once a minter calls reserveCollateral, they are required to:

  1. Transfer the underlying amount (e.g., XRP) to the agent’s underlying address.
  2. Call executeMinting with the corresponding payment proof.

This typically must be done before the deadline defined by lastUnderlyingTimestamp or lastUnderlyingBlock. However, the system does allow the minter to execute the minting even after the deadline, as long as the agent hasn’t triggered a default.

If the payment deadline expires and the agent has not received the payment, they are allowed to call CollateralReservations:mintingPaymentDefault with a non-payment proof. This action unlocks the agent’s locked collateral and deletes the collateral reservation associated with that minting process.

function mintingPaymentDefault(
        IReferencedPaymentNonexistence.Proof calldata _nonPayment,
        uint64 _crtId
    ) internal {
        ...SNIP...
        require(
            _nonPayment.data.responseBody.firstOverflowBlockNumber >
                crt.lastUnderlyingBlock &&
                _nonPayment.data.responseBody.firstOverflowBlockTimestamp >
                crt.lastUnderlyingTimestamp,
            "minting default too early"
        );
        
        ...SNIP...
    }

Impact Details

A minter can lose funds if the underlying blockchain experiences congestion or if validators deprioritise the transaction due to low fees. This situation is particularly relevant on blockchains where transaction inclusion is fee-based and non-deterministic.

Although the impact is a permanent loss of funds for the minter (making the severity critical), the likelihood of such an event occurring on a stable chain like XRP is relatively low-medium. Therefore, based on both factors, the overall severity is best rated as High( medium likelihood + critical impact = high)

References

https://github.com/flare-foundation/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/facets/CollateralReservationsFacet.sol#L127

Proof of Concept

Proof of Concept

  1. Alice (the minter) calls reserveCollateral. The payment deadline is set to 15 minutes or 500 blocks.
  2. After 14 minutes, Alice decides to execute the minting. She transfers 100 XRP to the agent’s underlying address.
  3. Due to network congestion or low gas fees, the Ripple network does not process Alice’s transaction for 2 minutes. The transaction remains in the mempool.
  4. The payment deadline passes. The agent, having not received payment, calls mintingPaymentDefault to release the locked collateral. This succeeds and deletes the reservation state.
  5. Two minutes later, Alice’s XRP transaction is finally processed. The 100 XRP is sent to the agent’s underlying address.
  6. Alice attempts to call executeMinting with the payment proof, but the transaction reverts because the collateral reservation no longer exists.

At this point, Alice’s 100 XRP is permanently lost. The agent has no obligation under the protocol to return the funds, even though they received them.

The original report as published on Immunefi, by ni8mare. 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 protocol allows the agent to declare a payment default based solely on the absence of payment by the deadline, without accounting for transactions that are already in the mempool but not yet confirmed.

Impact

The minter could permanently lose the transferred underlying funds, although the likelihood is low to medium on a stable chain like XRP.

What the attacker needed

Minter reserves collateral; minter sends underlying payment; transaction delayed in mempool; agent calls mintingPaymentDefault

How it was found

  1. Alice calls reserveCollateral, setting a payment deadline.
  2. Alice transfers the underlying amount to the agent's address.
  3. The transaction remains unconfirmed in the mempool past the deadline.
  4. The agent calls mintingPaymentDefault, which succeeds and deletes the reservation.
  5. Alice's transaction is later confirmed, sending the funds to the agent.
  6. Alice's attempt to call executeMinting reverts because the reservation no longer exists.

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 wants to create a new token, they first reserve collateral and then send the underlying asset (like XRP) to an agent. If the agent doesn't receive the payment by a deadline, the agent can cancel the reservation. But if the payment is delayed in the network and arrives after the cancellation, the sender's funds are lost because the reservation no longer exists.

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 ni8mare

View all

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