25952 - [SC - Insight] The smart contract could be inoperable due to w...

Submitted on Nov 21st 2023 at 22:07:40 UTC by @piken for Boost | DeGate

Report ID: #25952

Report type: Smart Contract

Report severity: Insight

Target: https://etherscan.io/address/0x2028834B2c0A36A918c10937EeA71BE4f932da52#code

Impacts:

  • The smart contract could be inoperable due to wrong replaceOwner() calling

Description

Bug Description

MultiSigWallet allows eligible owner to submit any transaction by calling submitTransaction():

    function submitTransaction(address destination, uint value, bytes data)
        public
        returns (uint transactionId)
    {
        transactionId = addTransaction(destination, value, data);
        confirmTransaction(transactionId);
    }

Other owners can confirm the transaction by calling confirmTransaction():

The transaction will be executed once confirmation numbers reach the threshold required

The owner of MultiSigWallet can also be replaced through above process. However, the owner could be replaced to address(0) if somehow the owners made a mistake. Additionally, if the total number of owners equals to threshold required before incorrect owner replacing, there would be no enough qualified owners to correct the mistake after the transaction was executed.

Impact

  1. MultiSigWallet will be inoperable

  2. Any assets in MultiSigWallet will be locked forever

Risk Breakdown

Difficulty to Exploit: Hard

Recommendation

Check if newOwner is address(0):

References

https://etherscan.io/address/0x2028834B2c0A36A918c10937EeA71BE4f932da52#code

Line165~Line180

Proof of concept

  1. Create a foundry project

  2. Copy below codes to test/MultiSigWallet.t.sol

  3. Run forge test --fork-url MAINNET_URL --chain-id 1 --fork-block-number 18620472 --match-test testUpdateOwner(replace MAINNET_URL with your Ethereum RPC URL to test:

Last updated

Was this helpful?