The notifyAccountTransfer
function in the Account NFT contract lacks a check for to != address(0)
. This oversight allows the possibility of the owner of a trading account being set to address(0)
, which can subsequently lead to the inability to deposit or withdraw from that account. This vulnerability can cause tokens to become irretrievably stuck in the contract.
The notifyAccountTransfer
function is designed to update the owner of a trading account when an account transfer occurs. However, it does not validate the to
parameter to ensure it is not address(0)
. As a result, if the to
address is set to address(0)
, the owner of the trading account becomes address(0)
.
In other parts of the contract, specifically in the deposit and withdraw functions, there are checks to determine if the owner of a token ID is address(0)
. If the owner is address(0)
, the account is considered non-existent, and no deposits or withdrawals can occur. This discrepancy can lead to a situation where tokens are stuck in the contract, as the new owner (now address(0)
) cannot perform any actions on the account.
The impact of this vulnerability is significant:
Token Lock: If the owner of a trading account is set to address(0)
, the tokens associated with that account become stuck in the contract, as no deposits or withdrawals can be made.
Loss of Access: Users may lose access to their tokens if the account ownership is inadvertently or maliciously set to address(0)
.
Contract Inconsistency: The contract's logic for handling accounts becomes inconsistent, potentially leading to further issues in contract functionality and user trust.
Manual review , Foundry
To mitigate this vulnerability, it is essential to add a check in the notifyAccountTransfer
function to ensure that the to
address is not address(0)
before updating the owner of the trading account.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.