The setRouter function in the StrategyArb contract updates the router address and approves the new router without revoking the approval from the old router address. This leaves active unlimited token approvals (type(uint256).max) to multiple router addresses, creating unnecessary security risks. A compromised router can use this approval to steal tokens or harm the protocol.
Location: setRouter function in StrategyArb.sol and StrategyOp.sol
Current Implementation:
The function fails to revoke the approval from the old router address before setting up the new approval
Each time the router is changed, a new unlimited approval is created while previous approvals remain active
This creates a situation where multiple router contracts have unlimited spending rights on the strategy's underlying tokens
Medium
If any previously approved router contract becomes compromised, malicious actors could:
Drain all underlying tokens up to the maximum uint256 value
Execute unauthorized trades
Potentially cause loss of funds through malicious transactions
Multiple active unlimited approvals increase the attack surface unnecessarily
Manual code review
Implement approval revocation before setting new approvals
Recommend using approve since safeApprove has been deprecated.
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.