#46541 [SC-High] Historical Payment Transaction Exploitation Leading to Instant Agent Liquidation
Submitted on Jun 1st 2025 at 12:48:34 UTC by @Bluedragon for Audit Comp | Flare | FAssets
Report ID: #46541
Report Type: Smart Contract
Report severity: High
Target: https://github.com/flare-foundation/fassets/blob/main/contracts/assetManager/library/Challenges.sol
Impacts:
Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
Description
Summary:
The illegalPaymentChallenge() function in the FAssets system can be exploited against newly created agents by challenging them for payment transactions that occurred before they registered as agents. Due to the PaymentConfirmations.VERIFICATION_CLEANUP_DAYS (14-day) verification window, any balance-decreasing transaction from an address within the past 14 days can be proven via Flare Data Connector, allowing malicious challengers to cause instant full liquidation of legitimate new agents.
Vulnerability Details:
The vulnerability exists in the challenge system where it accepts proofs of balance-decreasing transactions without verifying that the transaction occurred after the agent's registration timestamp or not.
When an agent creates a vault, the system doesn't protect against challenges for transactions that predate the agent's participation in the FAssets system.
The challenge mechanism in ChallengesFacet.sol only verifies that the transaction is not too old (within 14 days) but doesn't check if it occurred after agent registration.
Scenario (step by step):
Agent Registration:
Legitimate user creates agent vault using the monitored address
Agent deposits collateral and becomes available
Target Identification:
Malicious Challengers monitors XRPL for new agents underlying addresses with recent payment transactions (within 14 days)
Identifies an agents address that made payments without payment references before joining FAssets
Immediate Challenge:
Attacker calls
ChallengesFacet::illegalPaymentChallenge()with balance decreasing transaction proof of the pre-registration transactionSystem accepts the challenge since the transaction is within the 14-day window
Instant Liquidation:
Agent is immediately put into full liquidation status
Challenger receives reward from agent's collateral
Impact:
Instant Agent Liquidation: New agents can be immediately put into full liquidation status
Financial Loss: Agents lose their deposited collateral through forced liquidation
Barrier to Entry: Creates a disincentive for new agents to join the system
System Manipulation: Malicious actors can target specific addresses they know have recent transaction history
Recommended Mitigation:
Add a Registration Timestamp Check
Include a underlyingTimeStampAtCreation field in the agent state to store the timestamp when the agent was created. Then, modify the illegalPaymentChallenge() function to check that the transaction timestamp is greater than or equal to this registration timestamp.
This fix ensures that agents can only be challenged for transactions that occurred after they joined the FAssets system, preventing exploitation of pre-registration transaction history.
Proof of Concept
Proof of Concept:
Add the following test to the
Minitng.tsintest/unit/fasset/librarydirectoryRun the test using
yarn testHH
Logs
Was this helpful?