The contract PerpetualVault has a vulnerability in the _doGmxSwap function where there is no validation on the minOutputAmount parameter. This can lead to high slippage if the keeper provides a low minOutputAmount.
In the _doGmxSwap function, the contract performs a GMX swap using the following code:
There is no validation on the minOutputAmount parameter. If the keeper provides a low minOutputAmount, it can lead to high slippage during the swap, resulting in a significant loss of value.
Without validation on the minOutputAmount, the contract is vulnerable to high slippage during swaps. This can result in significant financial losses for the vault if the keeper provides a low minOutputAmount, leading to a poor exchange rate and loss of value.
Manual Review
Introduce a threshold for the minOutputAmount parameter and validate it before performing the swap. This ensures that the minOutputAmount is within an acceptable range, preventing high slippage and protecting the vault from significant financial losses.
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.