Closed sherlock-admin3 closed 6 months ago
1 comment(s) were left on this issue during the judging contest.
panprog commented:
low, dup of #19, it is impossible to create profitable sandwitch attack for uniswap2 liquidity removal (if uniswap2 pool price is manipulated away from fair price, tokens received for liquidity in USD terms will always be greater than tokens received for liquidity at the fair price)
Ironsidesec
medium
Sandwich attack on
OCL_ZVE.forwardYield
Summary
This issue is due to the wrong slippage implementation. Cannot be fixed by access control. Still, it can be sandwiched by MEV bots. And fixing it with proper slippage implementation is the way.
Look at the
pullFromLocker
, it has proper slippage implemented when burning LpVulnerability Detail
https://github.com/sherlock-audit/2024-03-zivoe/blob/01e00e6f27b58392a6fa0b82c84a46a783a0df3c/zivoe-core-foundry/src/lockers/OCL/OCL_ZVE.sol#L317
Look at line 322 with 0,0 as minimum returned tokenA and tokenB amounts
Attack path:
forwardYield
is called by anyone, either the keeper or anyone,forwardYield
to go through which will again burn the LP but it will receive lesser amounts because the atatcker frontran which will decrease the worth of LP.OCL_ZVE
Lp will be the attacker's gain.Impact
Sandwich attack / MEV on
OCL_ZVE.forwardYield
will makeOCL_ZVE
receive less amounts when burning the LP. Loos may be from 1 - 50% depending on liquidity and how much is theOCL_ZVE
is burning. So Medium.Code Snippet
https://github.com/sherlock-audit/2024-03-zivoe/blob/01e00e6f27b58392a6fa0b82c84a46a783a0df3c/zivoe-core-foundry/src/lockers/OCL/OCL_ZVE.sol#L317
Tool used
Manual Review
Recommendation
Modify https://github.com/sherlock-audit/2024-03-zivoe/blob/01e00e6f27b58392a6fa0b82c84a46a783a0df3c/zivoe-core-foundry/src/lockers/OCL/OCL_ZVE.sol#L317
Duplicate of #146