Skip to content
Smart contracts Audit finding Intermediate

ClaimAirdropDistribution() Allows Arbitrary Inflation of totalCollateral

The claimAirdropDistribution function adds the amount returned by an external distribution contract to totalCollateral without checking that any NAT tokens were actually received. A malicious agent could deploy a fake distribution contract that returns an arbitrary number, inflating their collateral and undermining pool accounting.

danvinci_20 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#46688 [SC-High] `claimAirdropDistribution()` Allows Arbitrary Inflation of `totalCollateral`

Submitted on Jun 3rd 2025 at 11:59:57 UTC by @danvinci_20 for Audit Comp | Flare | FAssets

Description

Description

The CollateralPool contract exposes a claimAirdropDistribution() function, allowing agents to claim distribution rewards via an external IDistributionToDelegators contract. However, there is no verification of the actual NAT tokens received by the pool, allowing an attacker to inflate the totalCollateral value by interacting with a malicious implementation of the interface.

The relevant implementation is shown below:

Solidity
function claimAirdropDistribution(
    IDistributionToDelegators _distribution,
    uint256 _month
)
    external
    onlyAgent
    returns(uint256)
{
    uint256 claimed = _distribution.claim(address(this), payable(address(this)), _month, true);
    totalCollateral += claimed;
    emit ClaimedReward(claimed, 0);
    return claimed;
}

Here, the amount returned by _distribution.claim(...) is added directly to totalCollateral without validating whether NAT tokens were actually transferred to the contract. Hence a malicious agent could deploy a contract that implements the interface IDistributionToDelegators and use it to inflate their collateral.

Impact Details

An attacker can arbitrarily increase the totalCollateral value by deploying a malicious IDistributionToDelegators contract with a claim() function that returns any desired number. Since totalCollateral is a critical state variable used in collateral ratio calculations, pool exits, and reward distributions, this undermines the integrity of the entire pool accounting system.

Recommendation

To mitigate this attack i recommend we do the following:

  1. Whitelist Trusted Distribution Contracts: Only allow pre-approved distribution contracts to be used in claimAirdropDistribution.
  2. Validate Transfers: Confirm that actual NAT tokens were received by the contract using balance tracking.

References

https://github.com/flare-foundation/fassets/blob/fc727ee70a6d36a3d8dec81892d76d01bb22e7f1/contracts/assetManager/implementation/CollateralPool.sol#L947-L959

Proof of Concept

Proof of Concept

The attacker follow this attack path:

  1. The attacker deploys a contract implementing IDistributionToDelegators with a custom claim() function returning an arbitrary large amount.
  2. The attacker calls claimAirdropDistribution() on the pool with the malicious distribution contract.
  3. The pool blindly adds the returned value to totalCollateral without receiving the actual NAT.

The pool state now reflects artificially inflated collateral, opening up downstream manipulation opportunities.

The original report as published on Immunefi, by danvinci_20. 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 function trusts the return value of an externally supplied contract and updates totalCollateral without verifying that the corresponding tokens were transferred.

Impact

The inflated totalCollateral could undermine collateral ratio calculations, pool exits, and reward distributions, potentially leading to protocol insolvency or theft of funds.

What the attacker needed

Attacker is an agent; attacker can deploy a malicious contract

The fix

The function should whitelist trusted distribution contracts and verify that the actual NAT token balance increased by the claimed amount before updating totalCollateral.

How it was found

  1. Deploy a contract implementing IDistributionToDelegators with a claim() function that returns an arbitrarily large amount.
  2. Call claimAirdropDistribution() on the pool, passing the malicious distribution contract.
  3. The pool adds the returned value to totalCollateral without receiving any NAT tokens.

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 smart contract function lets an agent claim rewards from an outside contract and adds the reported amount to their collateral balance. It never checks that the tokens really arrived, so an attacker can point it at a fake contract that just returns a huge number. This makes the pool think the attacker has far more collateral than they do.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by danvinci_20

View all

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

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.