The setRouter
function allows setting the router to the same address as the current router. When this happens:
The same router gets another max approval
Unnecessary gas is spent
The state transition effectively does nothing but still costs gas
The vulnerability is because the code assumes any router update is valid without checking if it actually changes the state. This is an incorrect assumption about state transitions.
When updating the router across any of the strategies, the previous router's approval is never revoked. This means:
Multiple routers maintain max approval to spend the strategy's underlying tokens (WETH)
This accumulation of approvals increases attack surface
If a previous router becomes compromised, it retains spending authority
In StrategyMainnet._initStrategy()
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.