There is no slippage check in PerpetualVault.sol#_doDexSwap().
PerpetualVault.sol#_doDexSwap() function is as follows.
As we can see above, there is no slippage check.
So an attacker can steal funds by sandwiching keeper's transaction.
_doDexSwap() function is called when keeper calls run()(long one leverage), runNextAction().
An attacker can steal funds from protocol by sandwiching keeper's transaction.
Manual Review
Add slippage check in _doDexSwap() function.
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.