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

In StrategyArb contract, asset allowance should be removed from the old router when updating to a new router

Summary

In the Arbitrum strategy, router can be upgraded using the corresponding setRouter function. The new address is set and allowance is activated. However, allowance for the old router is never revoked, leaving a security gap that could be exploited by a malicious actor.

Vulnerability Details

When setting a new router in the Arbitrum strategy (as in the case of the Optimism one), setRouter function is called and allowance to the new contract is activated. However, the old router allowance is not removed.

StrategyArb.sol
function setRouter(address _router) external onlyManagement {
// @audit - approval revoking for the old router is missing
router = _router;
underlying.safeApprove(router, type(uint256).max);
}

Keeping allowance on the old router is considered a security breach, as the contract is not created or maintained by any trusted actor within the Alchemix protocol, but by an external entity or organization. Doing this can bring several drawbacks, such as:

  • There is no guarantee that external actors are not malicious

  • Even if external actors are not malicious, a security issue in their old-version protocol contracts can directly compromise funds in the Alchemix system.

Impact

Impact: High

Likelihood: Low

Tools Used

Manual Review

Recommendations

It is recommended to remove allowance from the old router when setting a new one.

StrategyArb.sol
function setRouter(address _router) external onlyManagement {
+ underlying.safeApprove(router, 0);
router = _router;
underlying.safeApprove(router, type(uint256).max);
}
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.