A critical vulnerability exists in the swap state tracking mechanism due to improper handling of the swapProgressData structure. This flaw allows residual data from failed or mixed swap operations (DEX/GMX) to persist, leading to incorrect calculations of swapped amounts and global shares. Attackers can exploit this to manipulate share distributions, resulting in financial losses for users and protocol instability.
Shared State Without Isolation:
The swapProgressData struct is shared across all swap operations (DEX and GMX).
Residual data from prior swaps (especially failed ones) is not cleared, causing cross-operation contamination.
No Reset on Failure:
After a GMX swap fails (e.g., due to slippage or cancellation), swapProgressData.remaining retains its previous value.
Subsequent swaps incorrectly inherit stale data, leading to over/under-swapping.
Mixed Swap Types:
DEX and GMX swaps update the same swapProgressData, but their execution paths (success/failure) are not mutually isolated.
Step 1: User A initiates a DEX swap (5 ETH → Collateral Token) → succeeds.
swapProgressData.swapped is updated correctly.
Step 2: User B initiates a GMX swap (5 ETH → Collateral Token) → fails (e.g., price impact too high).
swapProgressData.remaining = 5 persists.
Step 3: User C initiates a new swap.
Contract erroneously treats the residual swapProgressData.remaining = 5 as valid.
Total swapped amount becomes swapped += new_output + 5 (incorrectly inflated).
Financial Losses: Users may lose funds due to incorrect share distribution or swap amounts.
Protocol Insolvency Risk: Repeated exploitation could drain collateral reserves.
Loss of Trust: Incorrect accounting undermines user confidence in the protocol.
Governance Manipulation: Attackers could accumulate excess shares to influence governance votes.
manual review
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.