Coinbase Smart Wallet - jesjupyter's results

Smart Wallet from Coinbase Wallet

General Information

Platform: Code4rena

Start Date: 14/03/2024

Pot Size: $49,000 USDC

Total HM: 3

Participants: 51

Period: 7 days

Judge: 3docSec

Id: 350

League: ETH

Coinbase

Findings Distribution

Researcher Performance

Rank: 51/51

Findings: 1

Award: $6.95

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

6.9492 USDC - $6.95

Labels

bug
downgraded by judge
grade-b
QA (Quality Assurance)
satisfactory
sufficient quality report
:robot:_46_group
duplicate-181
Q-16

External Links

Lines of code

https://github.com/code-423n4/2024-03-coinbase/blob/e0573369b865d47fed778de00a7b6df65ab1744e/src/SmartWallet/MultiOwnable.sol#L102-L110

Vulnerability details

Impact

The wallet is expected to be deployed on Ethereum, Base, Optimism, Arbitrum, Polygon, BNB, Avalanche, Gnosis. However, in L2, there might be reorg attack which could lead to a user accidentally loses control of the wallet. Thus the funds stored in the contracts are permanently lost.

Proof of Concept

There's no restriction on the situation that a owner shouldn't remove himself or the owner list can not be empty in the function removeOwnerAtIndex . Thus the wallet is vulnerable to reorg attack.

    function removeOwnerAtIndex(uint256 index) public virtual onlyOwner {
        bytes memory owner = ownerAtIndex(index);
        if (owner.length == 0) revert NoOwnerAtIndex(index);

        delete _getMultiOwnableStorage().isOwner[owner];
        delete _getMultiOwnableStorage().ownerAtIndex[index];

        emit RemoveOwner(index, owner);
    }

Consider the following situation:

  1. address A is the only user of the wallet.
  2. User calls addOwnerAddress with address A to add address B as the owner.
  3. Later, User calls removeOwnerAtIndex with address A to remove address A as the owner.
  4. Unluckily, reorg occurs and user first clears the ownership of address A and later wants to add address B. The later transaction would revert and the user lost control of the wallet forever.

Tools Used

Manual

Add restriction that a user can not remove himself or the owner list should not be empty after removal (use a counter to count owner numbers).

Assessed type

Governance

#0 - raymondfam

2024-03-22T03:41:34Z

Reorg doesn't work that way. But "the owner list should not be empty after removal" makes this a duplicate of #18.

#1 - c4-pre-sort

2024-03-22T03:42:22Z

raymondfam marked the issue as sufficient quality report

#2 - c4-pre-sort

2024-03-22T03:42:30Z

raymondfam marked the issue as duplicate of #18

#3 - c4-pre-sort

2024-03-22T22:32:15Z

raymondfam marked the issue as duplicate of #22

#4 - c4-pre-sort

2024-03-24T14:46:46Z

raymondfam marked the issue as duplicate of #181

#5 - c4-judge

2024-03-27T09:16:22Z

3docSec marked the issue as satisfactory

#6 - c4-judge

2024-03-27T18:01:27Z

3docSec changed the severity to QA (Quality Assurance)

#7 - c4-judge

2024-03-27T18:06:16Z

3docSec marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter