The MondrianWallet2 contract is vulnerable to unauthorized upgrades due to the lack of access control in the _authorizeUpgrade function.
When upgrading a smart contract using the UUPS pattern, the _authorizeUpgrade function needs to be overridden to implement access control for the upgrade process. Although the _authorizeUpgrade function is overridden in the MondrianWallet2 contract, it is missing any access control mechanism, allowing anyone to upgrade the contract.
Since the MondrianWallet2 contract inherits the upgradeToAndCall function from the UUPSUpgradeable contract, a malicious actor can call this function and upgrade the contract to a different implementation.
A malicious actor can upgrade the MondrianWallet2 contract to a different implementation.
Foundry
Add the requireFromBootLoaderOrOwner modifier to the _authorizeUpgrade function to ensure that only authorized entities (bootloader or owner) can upgrade the contract.
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.