Coinbase Smart Wallet - aycozynfada'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: 50/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)
sufficient quality report
:robot:_08_group
duplicate-18
Q-07

External Links

Lines of code

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

Vulnerability details

Impact

Malicious owner through the removeOwnerAtIndex() can remove other owners and make themselves the sole owner of the wallet. This is because the function's access modifiers only needs one owner executing this call to remove other owners.
Peradventure we have a wallet with 20 owners, a malicious owner on a rogue move can remove all other owners and gain sole access to the contract and gain access to all the funds in it.

Proof of Concept

The only owner access control modifier

   /// @notice Access control modifier ensuring the caller is an authorized owner
    modifier onlyOwner() virtual {
        _checkOwner();
        _;
    }

The check _onlyOwner() function which only needs one owner to valid to execute removeOwnerAtIndex()


    function _checkOwner() internal view virtual {
        if (isOwnerAddress(msg.sender) || (msg.sender == address(this))) {
            return;
        }

        revert Unauthorized();
    }
// @notice Removes an owner from the given `index`.
    ///
    /// @dev Reverts if the owner is not registered at `index`.
    ///
    /// @param index The index to remove from.
    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);
    }

Tools Used

Manual review, vs code

removeOwnerAtIndex() should only be executed by address.this following a consensus decision from all wallet owners.

Assessed type

Access Control

#0 - c4-pre-sort

2024-03-21T22:17:49Z

raymondfam marked the issue as sufficient quality report

#1 - c4-pre-sort

2024-03-21T22:17:55Z

raymondfam marked the issue as duplicate of #18

#2 - raymondfam

2024-03-21T22:18:46Z

See #18.

#3 - c4-pre-sort

2024-03-22T22:32:21Z

raymondfam marked the issue as duplicate of #22

#4 - c4-pre-sort

2024-03-24T14:46:51Z

raymondfam marked the issue as duplicate of #181

#5 - c4-judge

2024-03-27T09:01:32Z

3docSec marked the issue as not a duplicate

#6 - c4-judge

2024-03-27T09:01:37Z

3docSec marked the issue as duplicate of #18

#7 - c4-judge

2024-03-27T10:20:16Z

3docSec changed the severity to QA (Quality Assurance)

#8 - c4-judge

2024-03-27T10:21:49Z

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