Single-step process for critical ownership transfer
The Tracer Perpetuals Factory contract transfers ownership to a governance address in a single step during construction, making the change irreversible. If an incorrect address is used, all onlyOwner functions become permanently inaccessible, forcing redeployment and causing reputational damage.
Submitted by 0xRajeev
The Tracer Perpetuals Factory contract is arguably the most critical contract in the project given that it deploys all the markets. The ownership of this contract is transferred to _governance address, i.e. TracerDAO, in the constructor. This critical address transfer in one-step is very risky because it is irrecoverable from any mistakes.
The impact is that, if an incorrect address (e.g. one 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 deployer contract addresses and market approvals. This use of an incorrect address may not even be immediately apparent given that these functions are probably not used immediately. When noticed, due to a failing onlyOwner() function call, it will force the redeployment of the factory contract and require appropriate changes and notifications for switching from the old to new address. This will diminish trust in markets and incur a significant reputational damage. See issue page for proof of concept.
Recommend retaining the deployer ownership in the constructor and then using a two-step address change to _governance address separately using setter functions:
- Approve a new address as a
pendingOwner - A transaction from the
pendingOwner(TracerDAO) 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.
raymogg (Tracer) acknowledged:
Correct that having the owner be set to a wrong address could be detrimental, however for the first deploy of the factory, this will be owned by the DAO and will be easy to validate on deployment.
Subsequent ownership transfers will be done via DAO proposal, and will have many eyes across them (due to them being a public Tracer DAO proposal) before function execution happens.
For this reason it seems like a lot of overhead to have a two step process for this. Not withstanding that the issue you mention could still be possible
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 constructor sets the owner directly to the governance address without a two-step transfer mechanism, making errors irreversible.
Impact
If an incorrect address is used, all onlyOwner functions become permanently unusable, forcing redeployment and causing significant reputational damage.
What the attacker needed
Incorrect address used in constructor
The fix
The constructor should retain deployer ownership, and a two-step process (approve pendingOwner, then claim) should be used to transfer ownership to the governance address.
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 perform special actions. If the owner address is set incorrectly and cannot be changed, those actions are locked forever. This report suggests a safer two-step process to avoid such mistakes.
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.