MondrianWallet2::renounceOwnership
any funds left in the contract are stuck forever.Description: MondrianWallet2
inherits the function renounceOwnership
from openZeppelin's OwnableUpgradeable
. This function simply transfers ownership to address(0)
.
See OwnableUpgradeable.sol
:
As is noted in OwnableUpgradeable.sol
:
NOTE: Renouncing ownership will leave the contract without an owner,
thereby disabling any functionality that is only available to the owner.
Making any kind of transaction depends on a signature of the owner. As such, no transactions are possible after the owner renounces their ownership. This includes transfer of funds out of the contract.
Impact: In the life cycle of an Abstracted Account, renouncing ownership is a likely final action. It is very easy to forget to transfer any remaining funds out of the contract before doing so, especially when doing so in an emergency. As such, it is quite likely that funds are left in the contract by accident.
Proof of Concept:
A user deploys MondrianWallet2
and transfers ownership to their address.
The user transfers funds into the MondrianWallet2
account.
The user renounces ownership and forgets to retrieve funds.
User's funds are now stuck in the account forever.
Place the following in ModrianWallet2Test.t.sol
.
Recommended Mitigation: One approach is to override OwnableUpgradeable::renounceOwnership
function, adding a transfer of funds to the contract owner when renounceOwnership
is called.
Note that it is probably best not to make renouncing ownership conditional on funds having been successfully transferred. In some cases it might be more important to immediately renounce ownership (for instance when keys of an account have been compromised) rather than retrieving all funds from the contract.
Add the following code to MondrianWallet2.sol
:
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.