Skip to content
Access control Audit finding Beginner

Single-step process for critical ownership transfer/renounce is risky

The contract inherits a one-step ownership transfer and renounce function from Ownable without overriding it. An owner who accidentally transfers ownership to a wrong address could permanently lock all onlyOwner functions, forcing redeployment of the contracts.

0xRajeev Follow

Originally disclosed on Code4rena

Submitted by 0xRajeev

The SwappableYieldSource allows owners and asset managers to set/swap/transfer yield sources/funds. As such, the contract ownership plays a critical role in the protocol.

Given that AssetManager is derived from Ownable, the ownership management of this contract defaults to Ownable’s transferOwnership() and renounceOwnership() methods which are not overridden here. Such critical address transfer/renouncing in one-step is very risky because it is irrecoverable from any mistakes.

Scenario: If an incorrect address, e.g. for which the private key is not known, is used accidentally then it prevents the use of all the onlyOwner() functions forever, which includes the changing of various critical addresses and parameters. This use of incorrect address may not even be immediately apparent given that these functions are probably not used immediately. When noticed, due to a failing onlyOwner() or onlyOwnerOrAssetManager() function call, it will force the redeployment of these contracts and require appropriate changes and notifications for switching from the old to new address. This will diminish trust in the protocol and incur a significant reputational damage.

See similar High Risk severity finding from Trail-of-Bits Audit of Hermez.

See similarMedium Risk severity finding from Trail-of-Bits Audit of Uniswap V3:

Recommend overriding the inherited methods to null functions and use separate functions for a two-step address change:

  1. Approve a new address as a pendingOwner
  2. A transaction from the pendingOwner address claims the pending ownership change.

This mitigates risk because if an incorrect address is used in step (1) then it can be fixed by re-approving the correct address. Only after a correct address is used in step (1) can step (2) happen and complete the address/ownership change.

Also, consider adding a time-delay for such sensitive actions. And at a minimum, use a multisig owner address and not an EOA.

PierrickGT (PoolTogether) disputed:

This isn’t a security issue but an improper use of the initialize function. We do check for address zero so at least the risk of deploying the contract with address zero is excluded. Also, these contracts will be deployed by a multi sig owned by governance so the risk of a single human error is almost null.

0xean (Judge) commented:

Disagree with sponsor. A two step process would be a safer implementation. A multi-sig does not remove human error or the potential risk here. It may be an acceptable risk to the team, but still worth highlighting with the given severity.

PierrickGT (PoolTogether) acknowledged:

We have studied this solution and decided to not implement it since it would make it a pretty tedious process to deploy a swappable yield source, especially through the use of our builder which would mean that a user would have to manually claimOwnership after deploying a pool. Plus, this contract will be owned by governance so it will be very difficult to transfer it to another owner or renounce ownership.

The original report as published on Code4rena, by 0xRajeev. 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 contract relies on Ownable's single-step transferOwnership and renounceOwnership without overriding them to require a two-step confirmation.

Impact

A mistaken one-step transfer or renounce could permanently block all onlyOwner functions, forcing redeployment and damaging trust; the sponsor argued a multisig owner makes the risk almost null, but the judge disagreed.

What the attacker needed

Owner makes a typo in the new address; contract deployed by governance multisig

The fix

The report recommends overriding the inherited methods and using a two-step process where a pending owner must claim ownership, plus a time delay and a multisig owner; the sponsor acknowledged this but decided not to implement it.

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 contract often has an owner who can change important settings. This contract lets the owner hand over that role in a single action, with no confirmation step. If the owner types the wrong address by mistake, nobody can undo it and the contract's settings may be frozen forever.

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 0xRajeev

View all

61 more disclosed reports, best first.

More from PoolTogether

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.