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.
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
atvanguard (Hubble) disputed and commented:
Intended behavior because we don’t use
self.ownerafter the initial setup.
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.
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.