A critical vulnerability exists in the LendingPool contract’s _withdrawFromVault function (Lines 629-632), which interacts with the Curve crvUSD vault using zero slippage protection. Attackers can exploit this by front-running withdrawals to manipulate exchange rates, stealing protocol funds through arbitrage. This directly threatens the protocol’s liquidity reserves and solvency.
The _withdrawFromVault function withdraws liquidity from the Curve vault without specifying a minimum acceptable return (minAmountOut):
Hardcoded Zero Slippage: The 0 value for minAmountOut allows withdrawals to execute at any exchange rate, regardless of market conditions.
MEV Incentives: Bots can profitably sandwich attacks by manipulating the Curve pool’s state before and after the withdrawal.
Protocol Insolvency: Repeated exploitation drains liquidity reserves, rendering the protocol unable to honor user withdrawals.
MEV Extraction: Attackers systematically steal funds, eroding user trust and total value locked (TVL).
Gas Wars: Bots compete to exploit withdrawals, congesting the network and increasing transaction costs for legitimate users.
Hardhat: Simulated sandwich attacks and validated fund loss.
Manual Code Review: Identified hardcoded slippage parameters.
Slither: Analyzed external call risks to the Curve vault.
Deploy Mock Curve Vault: A manipulatable vault to simulate slippage attacks.
Deploy LendingPool: Configured to interact with the mock vault.
Seed Funds: Deposit 1000 crvUSD into the protocol’s Curve vault.
Dynamic Slippage Tolerance:
Oracle-Based Slippage Calculation:
Use decentralized oracles (e.g., Chainlink) to fetch real-time exchange rates and compute minAmountOut dynamically.
TWAP Protection:
Implement time-weighted average price (TWAP) checks for large withdrawals to mitigate short-term manipulation.
The absence of slippage protection in Curve vault withdrawals exposes the protocol to MEV-driven arbitrage, resulting in irreversible fund loss. By implementing dynamic slippage thresholds and oracle-based validations, the protocol can neutralize this risk and ensure sustainable liquidity management. Immediate action is required to prevent exploitation at scale.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.