in reimburseLiquidityFees() of SponserVault contract swaps tokens without slippage limit so its possible to perform sandwich attack and it create MEV #237
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Lines of code
https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/connext/helpers/SponsorVault.sol#L187-L220
Vulnerability details
Impact
when code swaps tokens it should specify slippage but in
reimburseLiquidityFees()
code contract callstokenExchange.swapExactIn()
without slippage and it's possible to perform sandwich attack and make contract to swap on bad exchange rates and there is MEV.Proof of Concept
This is
reimburseLiquidityFees()
code inSponserVault
:As you can see there is no slippage defined when calling
swapExactIn()
can that swap could happen in any exchange rate. it's possible to perform sandwich attack and do large swap before and after the transaction and make users lose funds. and it's also MEV opportunity.Tools Used
VIM
Recommended Mitigation Steps
specify slippage when calling swap tokens.
The text was updated successfully, but these errors were encountered: