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
Rank: 50/51
Findings: 1
Award: $6.95
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: 0xmystery
Also found by: 0xbrett8571, 0xhacksmithh, 7ashraf, Bigsam, Circolors, IceBear, Jorgect, Koala, Limbooo, SBSecurity, Tigerfrake, ZanyBonzy, aycozynfada, cheatc0d3, cryptphi, d3e4, doublespending, foxb868, gpersoon, imare, jesjupyter, lsaudit, robriks, shealtielanz, y4y
6.9492 USDC - $6.95
https://github.com/code-423n4/2024-03-coinbase/blob/main/src/SmartWallet/MultiOwnable.sol#L97-L110
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.
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); }
Manual review, vs code
removeOwnerAtIndex() should only be executed by address.this following a consensus decision from all wallet owners.
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