The protocol implements an emergencyPause function to be called by approved Keepers in an emergency situation. This function is designed to convert all liquidity pool tokens back to the underlying assets and hold them in the vault, also pausing all vault activities, including asset deposits, borrows, or rebalancing. However, the function fails to allow keepers to adjust the slippage that will be used when converting all liquidity pool tokens back to the underlying assets opening the door for MEV attacks.
The emergencyPause function is called by keepers in an emergency situation, this will call GMXManager.removeLiquidity which withdraws the protocol's liquidity from the pool without allowing for slippage adjustment
When liquidity is added in GMXManager.addLiquidity the minMarketTokens parameter will be zero (default value).
When liquidity is removed in GMXManager.removeLiquidity the minLongTokenAmount and minShortTokenAmount will also be set to zero (default value).
A malicious actor can sandwich the emergencyPause
function, leading to significant losses for the protocol.
Similarly, the emergencyResume
function is also susceptible to this issue when it attempts to add liquidity back into the pool without slippage adjustments.
Manual analysis
The emergencyPause
and emergencyResume
functions should be modified to include a slippage parameter that Keepers can adjust during each call.
Impact: High Likelihood: Low Because the whole lpToken balance is used during the emergency process, the impact is high. But the likelihood is LOW because of the dependence on the emergency.
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.