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

Missing remove approval for the old `router`

Summary

Missing remove approval for the old router.

Vulnerability Details

The permission of the old router hasn't been cleared, so it stil can deal with the underlying assets in the contract. This may lead to security risks.

Impact

The old router still has the authority to process the underlying assets in the contract.

Location

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

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyOp.sol#L48-L51

Recommendations

Remove the approval for the old router.

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

Appeal created

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

Old router approval is not revoked after an update

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