Users who deposit into the L1 ocntract will not be able to withdraw their tokens on L2 and also will not be able to retrive it on L1 causing the tokens to be stuck in the L1 escrow
Because the L1 Bridge::depositTokens(...)
function allows any random collection to be deposited when _whiteListEnabled
= false
(is whitelist is disabled). A malicious user can DOS L2 withdrawal causing NFTs deposited on L1 to be stuck
A malicious user can deploy many random NFT collections on L1 when white list is disabled and deposit the them individually by calling Bridge::depositTokens(...)
on L1 and then call bridge::withdraw_auto_from_l1(...)
to withdraw them on the L2 with the deposited L1 collections.
Now, because these tokens have not been deployed on the L2, when bridge::withdraw_auto_from_l1(...)
is called on the L2, the collections are deployed on the L2 and added to the collections list causing the loop on L504 below to be extremely large. The problem is that as shown in the link https://docs.starknet.io/tools/limits-and-triggers/, there is a block gas limit of 5,000,000 on starknet hence the loop will cause calls to withdraw_auto_from_l1(...)
to exceed the L2 block gas limit and revert.
SUMMARY:
whitelist is disabled
Dan a malicious user deploys many NFT collections that were not otherwise whitelisted on L1
Dan deposits all of the collections considering payload size limit making the
Dan calls withdraw_auto_from_l1(...)
from L1 and extends the white_listed_list
making the loop on L504 longer until a single call to withdraw_auto_from_l1(...)
can exceed 5,000,000 block gas limit (source: https://docs.starknet.io/tools/limits-and-triggers/) leading to gas exhaustion
Alice deposits Evarai in L1 (the transaction is successfully processed by the sequencer
Alice calls withdraw_auto_from_l1(...)
from L1 but the transaction reverts because block gas limit has been exceeded
Now Alice has no way to retrive her NFT form L1 where it was initially deposited
Worse yet is that the deposit cannot be retrieved by even the Admin because it has suceessfully been added by the sequencer and cannot be cancelled form L1.
This same attack can be performed by attacker to ensure funds are locked in the L2. So it goes both ways
NFT deposited in L1 will be stuck in the escrow leading to loss of funds for users.
Likelyhood: high
Impact: High (due to loss of NFT asset)
Manual review
Consider modifying
the Bridge::_isWhiteListed(...)
function on L1 as shown below
the bridge::_is_white_listed(...)
function on L2 as shown below
Likelyhood: High, once the whitelist option is disabled, collections will grow. Impact: High, withdraw won’t be possible because of Out-Of-Gas.
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.