The deposit()
function of the L1NftBridge(`starkLane`) contract allows users to deposit with the `ownerL2`address set to 0.
The only validation done is to ensure no overflow occurs in the "net" by checking the Val against the SN_MODULOU
`.
However In StarkNet users do not have addresses. Transactions sent to the network have the 0 address as caller.
In order to identify accounts via addresses, each user deploys their account contract and interacts with
contracts such as the `starkLane` used to bridge the Nfts using their account-contract.
The execution of `finalize_deposit` initiated by the `l1_handler` on l2 however will fail as sending or minting for the zero address will revert. As a result the deposited Nfts on L1 will be locked in
the escrow.
Assets are first deposited then locked in escrow, which will be retrieved in L2 by minting the same collectionType
and id
to the ownerL2
, however if the the ownerL2
is set to zero the NFt won't be minted as minting to the zero address is restricted on L2.
Malicious users can exploit the vulnerability to lock NFTs in escrow, preventing legitimate buyers from acquiring them if being sold to users on L2.
Deposited assets on L1 will be locked in escrow.
Manual Review
ownerL2 != 0 to ensure that the address is non-zero.
Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.
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.