MondrianWallet2::_authorizeUpgrade
is missing onlyOwner
access control to restrict upgrade implementation can only be done by owner
The function MondrianWallet2::_authorizeUpgrade
currently lacks an implementation to enforce that only the contract owner can call it. This oversight poses a significant risk during upgrades, potentially allowing non-owners to execute the upgrade process. That could introduce malicious functionalities in the new implementation, such as unauthorized fund transfers or actions that damage the owner's reputation or credibility.
Proof of Concept :
In the file test/ModrianWallet2Test.t.sol
, add the following test :
The test will pass indicating that any random user can upgrade the contract. However, the same test will fail if we add onlyOwner
modifier to MondrianWallet2::_authorizeUpgrade
as outlined in the recommendation section below.
New implementation can be done by non-owner resulting potential malicious functions/activities to be included in the upgraded contract.
Manual review
It's crucial to implement proper access control mechanisms to restrict the contract upgrades. Recommend to include onlyOwner
modifier to MondrianWallet2::_authorizeUpgrade
:
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.