The system executes GMX orders without proper slippage protection, which exposes the protocol to high price slippage, potentially leading to unexpected losses for users.
Vulnerable Code in _createIncreasePosition
minOutputAmount
is set to 0
, meaning the order will execute at any price, even if it's highly unfavorable.
No explicit slippage tolerance is set, meaning users could receive much worse execution prices than intended.
PoC
Users may suffer large unexpected losses due to price slippage.
Market manipulators could force bad execution prices for orders placed through this contract.
The protocol's reputation could be damaged if users experience consistent losses due to poor trade execution.
Manual review, Foundry
Implement a dynamic slippage protection mechanism based on market volatility.
Set minOutputAmount
dynamically based on expected execution price and a reasonable slippage threshold.
Allow users to specify acceptable slippage percentages when interacting with the vault.
acceptablePrice does that job for increase/decrease positions. https://github.com/gmx-io/gmx-synthetics/blob/caf3dd8b51ad9ad27b0a399f668e3016fd2c14df/contracts/order/BaseOrderUtils.sol#L276C49-L276C66
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.