Skip to content
Access control Audit finding Intermediate

Ownership of Swap.vy cannot be transferred

The ownership transfer function in Swap.vy is commented out, so the contract owner cannot be changed. If the owner keys are compromised or an upgrade is needed, funds could be stuck because there is no way to transfer ownership.

gzeon Follow

Originally disclosed on Code4rena

Submitted by gzeon

Ownership transfer function of Swap.vy is commented out. Fund can be stuck if an AMM and governance change/upgrade is required.

Proof of Concept

https://github.com/code-423n4/2022-02-hubble/blob/ed1d885d5dbc2eae24e43c3ecbf291a0f5a52765/contracts/curve-v2/Swap.vy#L1129

atvanguard (Hubble) disputed and commented:

Intended behavior because we don’t use self.owner after the initial setup.

JasoonS (judge) commented:

If that is the case, then shouldn’t this function have a check that the AMM can’t be set multiple times? https://github.com/code-423n4/2022-02-hubble/blob/ed1d885d5dbc2eae24e43c3ecbf291a0f5a52765/contracts/curve-v2/Swap.vy#L966-L970

There is risk if the owner keys get compromised - also there is no progressive security if you can’t change this.

IE it could start as an EOA - and progress to a multisig owner etc.

Leaving at medium severity - if you have an owner, there should always be a way to update it as to improve the security (and potentially decentralization) of the system over time.


The original report as published on Code4rena, by gzeon. 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 ownership transfer function was intentionally commented out, leaving no mechanism to change the owner.

Impact

If the owner keys are compromised or an upgrade is required, funds could be stuck because ownership cannot be transferred; the judge kept it at medium severity.

What the attacker needed

Owner keys compromised or upgrade needed

The fix

The ownership transfer function should be restored so the owner can be updated over time, improving security and decentralisation.

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.

In many smart contracts, an 'owner' account has special powers. Normally the owner can hand over that role to a new account. Here that hand-over function was disabled, so the original owner stays forever. If that account is lost or hacked, or if the system needs a new owner, there is no way to change it, which could lock funds.

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 gzeon

View all

46 more disclosed reports, best first.

More from Hubble contest

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.