DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: low
Valid

Approvals always remain active on previously used routers

Summary

The StrategyArb.sol and StrategyOp.sol contracts implement a setRouter function which is used to set a new router for the swaps:

function _initStrategy() internal {
router = 0xa062aE8A9c5e11aaA026fc2670B0D65cCc8B2858;
underlying.safeApprove(address(router), type(uint256).max);
}
function setRouter(address _router) external onlyManagement {
router = _router;
underlying.safeApprove(router, type(uint256).max);
}

However, when setting a new router, it doesn't reset the type(uint256).max WETH approval to the previous router.

Impact

Having open approvals to other protocols is always risky in case there is a vulnerability at said protocol. Also, as mentioned on LightChaser's report, it's impossible to set back a previously set router, since the safeApprove function reverts if the existing approval isn't 0.

Tools Used

Manual review

Recommendations

Always reset the approval to the previously used routers.

Updates

Appeal created

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Old router approval is not revoked after an update

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Old router approval is not revoked after an update

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.