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.
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:
Here, no validation is performed to ensure _router is not address(0).
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.
Manual Code Review and Foundry
Add a check to ensure that the address passed in is not the zero address before assigning it to the router variable. For example:
This validation step would ensure that the contract maintains a valid routing configuration at all times and prevents accidental misconfiguration.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.