The swap function executes an external call to ParaSwap without verifying the amount of tokens received, allowing trades to complete even if the swap results in significant losses due to price manipulation or malicious routing.
The function blindly trusts that the external swap execution is fair, without enforcing any minimum output amount. Since callData
is fully controlled by the caller and can interact with different liquidity sources, an attacker can exploit this by front-running the swap to cause an unfavorable execution price or by routing trades through malicious pools that return near-zero value. For example, if an attacker sees a large swap pending, they could execute trades that drastically alter token prices before the transaction is finalized, resulting in an execution at an extremely poor rate. Alternatively, if ParaSwap or an integrated liquidity provider is compromised, the swap could be intentionally routed through an attacker-controlled liquidity pool that returns far fewer tokens than expected. Since there is no post-swap validation of received amounts, the contract finalizes the transaction regardless of the loss, leading to catastrophic fund depletion.
Users can lose nearly all swapped funds due to price manipulation, front-running attacks, or malicious routing, with no recourse since the contract blindly accepts the swap results.
Decode callData
to extract the expected output amount and enforce slippage protection by requiring that the received amount meets or exceeds a minimum acceptable threshold before finalizing the swap.
Slippage and deadline are handled externally. Paraswap implementation used by the current code (behind the proxy): https://etherscan.io/address/0xdffd706ee98953d3d25a3b8440e34e3a2c9beb2c GMX code: https://github.com/gmx-io/gmx-synthetics/blob/caf3dd8b51ad9ad27b0a399f668e3016fd2c14df/contracts/order/OrderUtils.sol#L150C15-L150C33
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.