There is no slippage control on depositAsset() of LRTDepositPool, which expose user to sandwich attack.
Proof of Concept
Any deposit can be sandwiched in LRTDepositPool, especially when the pool is not balanced.
Exploit Scenario:
Bob, a normal user, calls depositAsset(). Since there is no minAmountOut, which means that the deposit can be executed at any price. As a result, when Eve sandwiches the deposit , Bob deposit the tokens without minting any, effectively giving away tokens for free.
Lines of code
https://github.com/code-423n4/2023-11-kelp/blob/main/src/LRTDepositPool.sol#L119-L144
Vulnerability details
Impact
There is no slippage control on
depositAsset()
ofLRTDepositPool
, which expose user to sandwich attack.Proof of Concept
Any deposit can be sandwiched in
LRTDepositPool
, especially when the pool is not balanced.Exploit Scenario:
Bob, a normal user, calls
depositAsset()
. Since there is nominAmountOut
, which means that the deposit can be executed at any price. As a result, when Eve sandwiches the deposit , Bob deposit the tokens without minting any, effectively giving away tokens for free.A Detailed Guide To Sandwich Attacks In DeFi.
Tools Used
Recommended Mitigation Steps
Add a
minAmountOut
indepositAsset()
Assessed type
MEV