The _authorizeUpgrade function of Swan contract is responsible for authorizing upgrades to the contract’s implementation when using the UUPS (Universal Upgradeable Proxy Standard) pattern. However, this function currently lacks a check to ensure that newImplementation is a non-zero address, which could lead to vulnerabilities or unintended behaviors in the upgrade process.
Without validating that newImplementation is a non-zero address, _authorizeUpgrade allows the possibility of mistakenly setting the contract’s implementation address to address(0). This could render the proxy contract non-functional, as calls to the proxy would delegate to an empty address, likely resulting in a failure of the contract's core functions.
If an upgrade is executed with newImplementation set to address(0), the contract’s proxy may lose functionality entirely. This would impact users relying on the contract’s functions and could lead to a complete loss of operability.
manual
To ensure that only valid addresses can be set as new implementations, add a check for address(0) in the _authorizeUpgrade function.
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.