Cheerful Taffy Dolphin - Lack of Slippage Protection in Share Minting Allows MEV Sandwich Attacks and Market Manipulation Which can Extract Value From Depositors #40
Labels
Sponsor Disputed
The sponsor disputed this issue's validity
Cheerful Taffy Dolphin
Medium
Lack of Slippage Protection in Share Minting Allows MEV Sandwich Attacks and Market Manipulation Which can Extract Value From Depositors
Summary
There is no slippage protection in the Vault's deposit mechanism, which means users have no way to specify minimum shares they expect to receive when depositing assets. This omission exposes users to potential value loss through share price manipulation and market movements during the transaction confirmation period. While the contract handles the deposit-to-shares conversion through
convertToShares()
, it lacks any guardrails to protect users from executing deposits at unexpectedly unfavorable rates.The vulnerability manifests in the share price calculation mechanics within the vault's deposit flow. When users deposit assets, the conversion to shares occurs through
convertToShares()
:The core issue is that the
_update()
function accepts the deposit and mints shares without any minimum share output validation:https://github.com/sherlock-audit/2025-01-perennial-v2-4-update/blob/main/perennial-v2/packages/vault/contracts/Vault.sol#L313
The share price can be manipulated between transaction submission and execution through multiple vectors:
_manage()
, affectingtotalAssets()
context.global.update()
This allows MEV bots to sandwich deposit transactions by:
Impact
The vulnerability creates a systemic risk for depositors since their transactions can be exploited by MEV bots or suffer from adverse price movements with no recourse to revert based on share output. The lack of slippage protection means every deposit transaction is potentially vulnerable to sandwich attacks and market manipulation, leading to direct value extraction from depositors.
Fix
The fix requires adding slippage validation during the deposit flow:
This enforces user-specified minimum share requirements before proceeding with deposit execution.
The text was updated successfully, but these errors were encountered: