Summary
The claimAndSwap and setRouter functions in the StrategyOp contract lack rate-limiting mechanisms, exposing the strategy to risks such as rapid asset depletion, gas exhaustion, and operational disruptions. Without rate-limiting, these functions can be abused to manipulate strategy operations, disrupt functionality, or cause significant financial losses.
Mitigation includes implementing cooldown periods or time-based restrictions to ensure these critical functions cannot be executed excessively within short timeframes.
Technical Details
The affected functions currently lack rate-limiting mechanisms:
claimAndSwap:
setRouter:
claimAndSwap:
Swaps underlying tokens (WETH) for strategy assets (alETH).
Can be called by Keepers.
setRouter:
Updates the address of the router for token swaps.
Can be called by Management.
These functions can be invoked repeatedly within short timeframes, leading to:
Rapid Depletion of Funds:
Repeated swaps can exploit timing conditions or market volatility, draining strategy assets.
Router Manipulation:
Frequent router updates disrupt operations and increase gas costs.
Gas Limit Exhaustion:
Excessive calls lead to resource exhaustion, causing transaction failures and potential denial of service (DoS).
Exploitation Scenarios
Setup:
The attacker has Keeper privileges to call claimAndSwap.
Execution:
The attacker calls claimAndSwap repeatedly within milliseconds, exploiting market volatility or slippage conditions.
Impact:
Strategy assets are rapidly drained due to repeated swaps, leading to significant financial loss.
Setup:
A malicious Manager repeatedly calls setRouter to disrupt swap operations.
Execution:
Impact:
The strategy’s operations become unpredictable due to frequent router changes, increasing gas costs and operational inefficiency.
Setup:
Repeated calls to either function within the same transaction.
Impact:
Gas exhaustion leads to failed transactions, causing potential DoS conditions for the protocol.
Impact Analysis
Financial Impact:
Rapid depletion of assets due to repeated swaps or router changes.
Quantifiable example: Repeated swaps drain 10,000 WETH, causing a loss of ~$20M (at $2,000/WETH).
Operational Impact:
Frequent router updates disrupt the strategy’s functionality.
Gas exhaustion can cause DoS, blocking legitimate transactions.
Reputational Impact:
Users lose trust in the protocol due to unpredictable operations and potential financial losses.
Root Cause Analysis
Lack of Cooldown Mechanisms:
No restrictions are in place to limit the frequency of function calls.
Insufficient Access Control:
While access control exists (onlyKeepers and onlyManagement), it does not prevent abuse by authorized actors.
Mitigation Recommendations
introduce a cooldown period to enforce a minimum interval between consecutive calls:
Similarly, for setRouter:
Introduce governance-based limits for critical operations.
Proof of Concept (PoC)
** Reproduction:**
Deploy the contract and grant Keeper privileges to an attacker.
Execute repeated claimAndSwap calls within a short timeframe.
Observe the rapid depletion of strategy assets or slippage exploitation.
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.