Closed sherlock-admin2 closed 9 months ago
1 comment(s) were left on this issue during the judging contest.
takarez commented:
invalid
Invalid, this is intended, transfers can only be performed via the factory. Accounts themselves can never (may never) be transferred by themselves without getting processed in the factory.
PR-Security
medium
Factory.sol#safeTransferAccount()
function never will work, when Account itself want to transfer ownershipSummary
The issue identified pertains to the ownership transfer mechanism of an Account within the Arcadia Protocol, specifically involving the
Factory.sol#safeTransferAccount()
function and its interaction withAccountV1.sol#transferOwnership()
function. The current implementation restricts thetransferOwnership()
function to be callable only by the Factory contract, which may lead to a logical inconsistency or limitation for account owners wishing to transfer their account ownership directly.Vulnerability Detail
The core of the issue lies in the intended functionality that allows an account owner to transfer ownership of their account. The expected process involves the account itself initiating the transfer by calling
Factory.sol#safeTransferAccount()
. For this transfer to be valid, the account's ownership must be transferred internally, necessitating a call toAccountV1.sol#transferOwnership()
.However,
AccountV1.sol#transferOwnership()
is designed to be callable exclusively by the Factory contract. This design choice creates a scenario where the account, despite being the owner and initiator of the transfer, cannot directly invoke the necessary function to transfer ownership due to the restrictive permission set ontransferOwnership()
.Impact
This restriction significantly impacts the autonomy and flexibility of account owners in managing the ownership of their accounts. It introduces a dependency on the Factory contract for actions that account owners should be capable of initiating and completing independently. This not only complicates the ownership transfer process but also potentially delays or restricts the ability of account owners to manage their assets efficiently.
Code Snippet
https://github.com/sherlock-audit/2023-12-arcadia/blob/main/accounts-v2/src/Factory.sol#L216-L248
Tool used
Manual Review
Recommendation
To resolve this issue, a more flexible permission model for the
transferOwnership()
function inAccountV1.sol
is recommended. One approach could be to allow the account itself (i.e., the current owner) to calltransferOwnership()
, in addition to the Factory contract. This can be achieved by modifying the require statement to include a check that allows either the Factory or the current owner to execute the function: