Summary
The claimAndSwap function is susceptible to transaction reordering, which could exploit the protocol's reliance on optimistic rollups for execution ordering. Without sufficient safeguards such as dynamic slippage protection, the protocol risks swaps executing at manipulated prices, reducing user yields and exposing the protocol to economic inefficiencies.
This vulnerability arises from predictable transaction parameters and static slippage checks (_minOut), which fail to adapt to real-time market conditions. Mitigation through slippage controls and improved execution validation is recommended.
Technical Details
The claimAndSwap function facilitates swaps via preconfigured routes, relying on Keepers to execute without incorporating additional validations:
Static Slippage Checks:
_minOut is user-defined and static, failing to account for dynamic market conditions, price fluctuations, or manipulation.
Sequencer Transaction Ordering Risk:
Centralized sequencers on Optimism can reorder or delay transactions, allowing Keepers or colluding actors to execute trades at unfavorable prices for the protocol.
Lack of Additional Safeguards:
No mechanism ensures swaps occur at optimal rates based on current market conditions (e.g., real-time oracle integration).
Exploitation Scenarios
Setup:
The protocol relies on Keepers to execute a claimAndSwap with _amountClaim = 1,000 WETH and _minOut = 980 alETH.
Execution:
A Keeper submits the transaction during a period of high market volatility.
Before execution, market conditions shift, reducing the value of the trade to 950 alETH.
Impact:
The protocol suffers a slippage loss of 30 alETH, impacting yields and returns.
Setup:
A Keeper submits a claimAndSwap transaction with _amountClaim = 500 WETH and _minOut = 490 alETH.
Execution:
A colluding Keeper submits a higher-priority transaction to execute a large WETH-alETH trade, manipulating the price.
The original Keeper’s transaction is processed after the price manipulation, causing it to execute at an unfavorable rate.
Impact:
The manipulated price results in a reduced swap return, impacting protocol efficiency.
Impact Analysis
Financial Impact:
Suboptimal swaps and manipulated prices reduce yields and user returns.
Operational Impact:
Reordering of transactions disrupts the protocol’s intended yield-generation process.
Reputational Impact:
Loss of trust in the protocol’s ability to ensure secure and optimal swaps.
Root Cause Analysis
Predictable Transaction Parameters:
_amountClaim and _minOut are fixed and exposed in execution, leaving the protocol vulnerable to dynamic price shifts.
Reliance on Centralized Sequencer:
The protocol assumes benign behavior from the sequencer without validating execution outcomes.
Lack of Market-Aware Safeguards:
Swap execution relies solely on Keeper-defined parameters without incorporating real-time price data.
Mitigation Recommendations
Mechanism:
Use real-time on-chain oracles to calculate _minOut dynamically based on market conditions.
Mechanism:
Implement a commit-reveal scheme to obfuscate transaction details before execution, reducing predictability.
Mechanism:
Set a strict time window for swap execution, reverting transactions that exceed this limit.
Mechanism:
Introduce checks to detect and revert transactions with sudden price deviations during execution.
Deploy the contract and simulate a transaction submission with _amountClaim = 1,000 WETH and _minOut = 980 alETH.
Execute a price manipulation or delayed transaction reordering in a sequencer simulation.
Observe the impact on the executed swap, with reduced outputs or higher slippage.
Implement dynamic slippage controls and commit-reveal logic.
Submit transactions with hidden parameters and validate correct execution against the commit phase.
Ensure time-bound execution prevents delayed or manipulated swaps.
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.