The StrategyArb and StrategyMainnet contracts introduce two centralization risks:
Router Address Control: The Manager role can arbitrarily set the router address, enabling potential malicious activity if compromised.
Swap Routes Configuration: The Manager can define custom swap routes via the addRoute function, which can lead to fund redirection or inefficient swaps.
Both issues pose severe financial, operational, and reputational risks. Mitigation includes decentralizing control through multi-signature governance, implementing robust validation checks, and adopting preventative coding practices.
Code Reference:
Router address initialized in _initStrategy:
Updatable via setRouter:
Issue:
The onlyManagement modifier grants the Manager role control over the router address.
If compromised, the Manager can update the router to a malicious contract, which can perform unauthorized swaps or drain funds.
Code Reference:
Add routes via addRoute:
Issue:
The Manager can define arrays of routes, parameters, and pools without validation.
Malicious routes can redirect funds to external wallets or execute inefficient swaps, leading to financial losses.
Scenario:
Manager updates the router to a malicious contract they control.
During a _swapUnderlyingToAsset operation:
The malicious router redirects funds to an attacker-controlled wallet.
Proof of Concept:
Assume the contract holds 5,000 WETH (~$10M at $2,000/WETH).
The malicious router executes swaps that result in a direct transfer to an attacker wallet:
Impact:
Full loss of all 5,000 WETH.
Operational disruption and reputational damage to the protocol.
Scenario:
Manager defines a malicious route:
A claimAndSwap operation executes the malicious route:
The malicious route swaps assets at inefficient rates or redirects funds.
Proof of Concept:
Assume the protocol manages $50M in assets.
A malicious route swaps 10% of the funds ($5M) at a manipulated rate, resulting in a $4.8M net loss.
Funds are directed to an attacker-controlled pool.
Root Cause Analysis
Router Address Control:
Centralized control via onlyManagement without additional safeguards.
Unlimited token approvals (type(uint256).max) exacerbate the risk.
Swap Routes Configuration:
Lack of validation for routes, parameters, and pools.
No multi-signature requirement for route addition.
Replace onlyManagement with multi-signature governance for critical operations like setRouter and addRoute.
Validate router addresses and swap routes against pre-approved lists.
Worst-Case Impact: Loss of all funds managed by the strategy.
Quantifiable Example: $10M drained due to malicious router.
Worst-Case Impact: Inefficient trades or fund redirection leading to multi-million-dollar losses.
Quantifiable Example: $4.8M loss due to manipulated trade rates.
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.