Skip to content
Access control Audit finding Advanced

Remove owner calls can be replayed to remove a different owner at the same index, leading to severe issues when combined with lack of last owner guard

A cross-chain replayable owner-removal call could remove a different owner at the same index on another chain, potentially deleting the last accessible owner and permanently locking the account.

Circolors Follow with lsaudit

Originally disclosed on Code4rena

Submitted by Circolors, also found by lsaudit

Users are able to upgrade their account’s owners via either directly onto the contract with a regular transaction or via an ERC-4337 EntryPoint transaction calling executeWithoutChainIdValidation. If a user chooses to use a combination of these methods it’s very likely that the addresses at a particular ownership index differ across chain. Therefore if a user later calls removeOwnerAtIndex on another chain will end up removing different addresses on different chains. It is unlikely this would be the user’s intention. The severity of this ranges from minimal (the user can just add the mistakenly removed owner back) or critical (the user mistakenly removes their only accessible owner on a specific chain, permanently locking the account).

Proof Of Concept

Scenario A: Alice permanently bricks her account on an unused chain:

  1. Alice has a CoinbaseSmartWallet, and uses it on Base, Ethereum & Optimism
  2. Alice later decides to add a new owner using a cross-chain executeWithoutChainIdValidation
  3. Alice later wants to remove the initial owner (index 0) and does so by signing another cross-chain replayable signature
  4. Despite it not being her intention anyone could take that signature and replay it on Arbitrum, Avalanche, etc as there is no check to stop the user from removing the final owner

Scenario A: Alice adds owners using both methods and ends up with undesired results:

  1. Alice has a CoinbaseSmartWallet and uses it across all chains
  2. She has Gnosis Safe’s and ERC-6551 token bound accounts on different chains so adds them as owners on those specific chains using execute
  3. She then adds a secondary EOA address on all chains using executeWithoutChainIdValidation
  4. Now if she uses executeWithoutChainIdValidation to call removeOwnerAtInde she will be removing different owners on different chains, which is likely not her intention

While more complex scenarios than this might sound bizarre it’s important to remember that Alice could be using this smart account for the next N years, only making changes sporadically, and as her ownership mappings across different chains become more out of sync the likelihood of a significant error occurring increases.

Recommended Mitigation Steps

As MultiOwnableStorage uses a mapping to track owner information rather than a conventional array, it might be simpler to do away with the indexes entirely and have a removeOwner(bytes calldata _ownerToRemove) function. This would avoid the situations outlined above where when calling removeOwnerAtIndex removes different owners on different chains. To ensure replayability and avoid having a stuck nonce on chains where _ownerToRemove is not an owner the function should not revert in the case the owner is not there, but instead return a bool removed to indicate whether an owner was removed or not.

This would make it significantly less likely that users run into the issues stated above, without having to limit their freedom to make ownership changes manually or via ERC-4337 EntryPoint transactions.

3docSec (judge) increased severity to High and commented:

Root cause: removeOwnerAtIndex can be replayed cross-chain despite the same index may point to a different owner. The issue was confirmed by the sponsor in the issue #57 thread and addressed in this PR.

After consulting with a fellow judge, I’m upgrading this one as high, as there is a well-defined attack path that causes the user to lose ownership of their wallet.

Coinbase mitigated:

The issue is remediated by updating the parameterization of removeOwnerAtIndex to also take an owner argument. We then check that the owner passed matches the owner found at the index. In this way, we prevent a replayable transaction removing a different owner at the same index. (PR here)

Status: Mitigation confirmed. Full details in reports from McToady, cheatc0d3, and imare.


The original report as published on Code4rena, by Circolors. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the removal function identifies an owner only by index, and the signed call can be replayed across chains where the same index maps to a different owner.

Impact

The user could lose ownership of the wallet on a chain, and if the removed owner was the only accessible one the account is permanently locked.

What the attacker needed

Same smart wallet used on multiple chains; owners added via cross-chain replayable calls; signed removal call replayed on another chain

The fix

The removal function was changed to also take the expected owner address and check it matches the owner at that index, preventing a replay from removing a different owner.

How it was found

  1. Alice uses the same smart wallet on several chains.
  2. She adds owners on some chains with a normal transaction and on all chains with a cross-chain replayable transaction.
  3. She signs a cross-chain replayable call to remove the owner at a chosen index.
  4. Anyone can replay that signed call on another chain, where the same index holds a different owner.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart wallet lets several 'owners' control it, and each owner sits at a numbered slot. A signed instruction to remove the owner in slot zero can be replayed on another blockchain, where slot zero may hold a different person. If that person was the only remaining owner, the wallet can no longer be controlled.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Circolors

View all

3 more disclosed reports, best first.

More from Smart Wallet

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.