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

When setting new router in StrategyArb contract the previous approve is not revoked.

Summary

There is `setRouter` function in `StrategyArb.sol` contract that when called it sets the router variable to the new router and grants approve for the new router to type(uint256).max.

router = _router;
underlying.safeApprove(router, type(uint256).max);

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyArb.sol#L42

Vulnerability Details

There is no revoking of approval for the preious router.

There is no reason for the old router to have approval which is not used anymore.

Impact

Leaving approval of router that is not used by the protocol may become problematic in the future.

Tools Used

Manual review

Recommendations

Remove approval for the old router.

Updates

Appeal created

inallhonesty Lead Judge 10 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.