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

Zero Address Check Missing in setRouter()

Summary

The setRouter function in StrategyOp.sol and StrategyArb.sol lacks a zero address validation check when setting a new router address.

Vulnerability Details

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

The function allows setting the router address to address(0) without any validation.

Impact

If the router address is accidentally set to zero:

  • Token swapping functionality would be temporarily broken

  • Additional transaction would be needed to fix the issue

Recommendations

Add a zero address validation check at the beginning of the function:

function setRouter(address _router) external onlyManagement {
+ require(_router != address(0), "Zero address not allowed");
router = _router;
underlying.safeApprove(router, type(uint256).max);
}

This check will prevent potential operational issues and follows smart contract security best practices.

Updates

Appeal created

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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