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

Router update fails to remove all the previous token allowances of StrategyOp and StrategyArb from the previous router implementation.

Router update fails to remove all the previous token allowances of StrategyOp and StrategyArb from the previous router implementation.

StrategyOp safe approves all of it's underlying token to the router

File: https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyOp.sol#L38-L41

router = 0xa062aE8A9c5e11aaA026fc2670B0D65cCc8B2858;
underlying.safeApprove(address(router), type(uint256).max);
}

StrategyArb safe approves all of it's underlying token to the router

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

function _initStrategy() internal {
router = 0xAAA87963EFeB6f7E0a2711F397663105Acb1805e;
underlying.safeApprove(address(router), type(uint256).max);
}

setRouter function can be used to update the router implementation at will by the managment

Files:

The Strategy contract at no point in time removes the allowances from the old router. This results in old router instances still having spending rights on the respective Strategies underlying tokens.

Impact
Old router instances still have spending routes over the Strategies respective tokens and given that, some of these routers are upgreadable, it opens a potential door through which the protocol or a devious hacker can rug pull everyone if they have access to the old router admin rights.

Recommended Mitigation
We should remove the allowances of the old router before updating it in the setRouter function

Updates

Appeal created

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