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.
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
- Report ID: #46688
- Report Type: Smart Contract
- Report severity: High
- Target: https://github.com/flare-foundation/fassets/blob/main/contracts/assetManager/implementation/CollateralPool.sol
- Impacts:
- Protocol insolvency
- Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
- Theft of unclaimed yield
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:
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:
- Whitelist Trusted Distribution Contracts: Only allow pre-approved distribution contracts to be used in
claimAirdropDistribution. - Validate Transfers: Confirm that actual NAT tokens were received by the contract using balance tracking.
References
Proof of Concept
Proof of Concept
The attacker follow this attack path:
- The attacker deploys a contract implementing
IDistributionToDelegatorswith a customclaim()function returning an arbitrary large amount. - The attacker calls
claimAirdropDistribution()on the pool with the malicious distribution contract. - The pool blindly adds the returned value to
totalCollateralwithout receiving the actual NAT.
The pool state now reflects artificially inflated collateral, opening up downstream manipulation opportunities.
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
- Deploy a contract implementing IDistributionToDelegators with a claim() function that returns an arbitrarily large amount.
- Call claimAirdropDistribution() on the pool, passing the malicious distribution contract.
- 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.