Slippage protection is not applied for decreasePosition. While creating the increasePosition minOutputAmount denotes the minimum token amount after the initialCollateralDeltaAmount is swapped through the swapPath but in the protocol we do not swap tokens while increasing the position hence setting minOutputAmount = 0 makes sense but while decreasePosition minOutputAmount denotes minimum USD value, USD is used in this case because it is possible for decrease orders to have two output tokens. Hence for creating the decreased position it should set the value accordingly otherwise it may lose the value because of the nature of the GMX protocol(asynchronous).
For decreasePosition, minOutputAmount represents the minimum acceptable USD value for the order, as decrease orders can output two different tokens. The current implementation does not enforce slippage protection for decreasePosition orders.
Example:
An attacker detects a decreasePosition order with a weak slippage protection parameter. They quickly execute a transaction on GMX to move the price—such as by selling a significant volume of the output token—which causes the price to drop. When the original decreasePosition order is executed, it receives a lower USD value than expected. The attacker then reverses the price manipulation (for example, by buying back tokens at the lower price) and profits from the difference. This backrunning strategy makes a profit to the malicious user at the expense of the protocol.
The protocol can make losses due to the unfavorable execution price of decreasePosition orders.
Manual Review
Add slippage protection while creating the decrease position.
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.