Closed sherlock-admin closed 1 year ago
So we have quite a few duplicates of this, and I believe we might have mentioned it in the initial contest information.
We created the 5095 intentionally in a way to have backwards compatability with eip4626.
This includes the lack of additional slippage parameters, as adding them would break eip4626 compliance.
It may be a decent suggestion to add additional override methods with them (we considered doing exactly that), but we had run into bytecode size issues and have our reservations on that end.
hyh
medium
Illuminate PT token pool operations results can be manipulated by sandwich attacks
Summary
Sandwich attacks are possible for 5095 poll linked ops as there are no slippage control,
99% * predicted
doesn't provide any safeguard against pool manipulations as previews are based on the pool state that can be altered. While EIP-4626 compliance is a stated reason for the absence of minimal accepted return parameter, there is no other functions that can provide the slippage control needed, i.e. a user who wants to control the execution cannot do it.Vulnerability Detail
All pool interacting functions do not have slippage control, using preview amounts from the same pool. These versions of the functions are the only ones with this functionality, so a user cannot control the execution in any way.
Impact
User can be subject to sandwich attack, altering the state of the pool before the trade and returning it back thereafter.
Setting the severity to medium as net impact here is a partial fund loss conditional only on big enough asset amount to be swapped: sandwich attacks are common and can be counted to happen almost always as long as economic viability is present.
Code Snippet
deposit(), mint(), withdraw(), redeem() do not have slippage control and alternatives:
https://github.com/sherlock-audit/2022-10-illuminate/blob/main/src/tokens/ERC5095.sol#L145-L345
Tool used
Manual Review
Recommendation
Consider introducing the versions of deposit(), mint(), withdraw() and redeem() that employ a minimal accepted return parameter so the user can control the realized slippage to protect from the sandwich attacks.