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

Missing Zero-Address Validation on Critical Configuration

01. Relevant GitHub Links

02. Summary

The contract assigns addresses to certain state variables (e.g., router) without validating that they are non-zero. This can result in a situation where the logic dependent on this address becomes unusable if it is mistakenly set to address(0). Although not a front-running vulnerability, it can disrupt protocol functionality and availability.

03. Vulnerability Details

The issue arises from the lack of an address(0) check when assigning router addresses. If an address that is meant to facilitate token routing operations is set to the zero address, any functions relying on it would fail. For instance:

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

Here, no validation is performed to ensure _router is not address(0).

04. Impact

If the router variable is set to the zero address, token approvals and subsequent routing logic will fail. This could freeze the ability to perform necessary swaps, limiting yield generation or liquidity operations dependent on the router’s functionality.

05. Tools Used

Manual Code Review and Foundry

06. Recommended Mitigation

Add a check to ensure that the address passed in is not the zero address before assigning it to the router variable. For example:

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

This validation step would ensure that the contract maintains a valid routing configuration at all times and prevents accidental misconfiguration.

Updates

Appeal created

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 6 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.