Bridging back tokens to the originator chain will be impossible until the admin steps in and manually adds both collections to the respective mappings, the issue will happen no matter the direction of bridging.
As it was stated in the Discord channel, here issues that can happen when the whitelist is disabled are in scope of the audit.
Now, let’s review what will happen when users try to bridge ERC721
tokens that are not yet configured by the admins:
Bridge::depositTokens
is called passing any collectionL1
that doesn’t persist in _l1ToL2Addresses
and _l2ToL1Addresses
mappings, so request::collectionL2
will be address(0)
Bridging is successful, the transaction is received on Starknet
, and bridge::withdraw_auto_from_l1
is called:
ensure_erc721_deployment
will deploy new ERC721 token, which will be the representation of the Ethereum
NFT on L2, and configure the l2_to_l1_addresses
and l1_to_l2_addresses
, as well as automatically whitelisting it for next bridges that will happen (this is valid only for bridges in the same direction, i.e. only L1 → L2 will work):
User decides he doesn’t need to keep the token in L2 anymore, or he is forced to bridge it back to L1, for example his rent period is expiring and he can lose his collateral if he doesn’t return it in time. bridge::deposit_tokens
is called which will set collectionL1
address to the real NFT address on L1 and send the tx.
Payload is bridged successfully and the user is in a hurry to redeem his NFT so he can return it and calls Bridge::withdrawTokens
with the valid payload, that has collectionL1
= real ERC721 address, but when CollectionManager::_verifyRequestAddresses
is called the following revert will be caused:
InvalidCollectionL1Address
will be thrown until the admin doesn’t step in and call the Bridge::setL1L2AddressMapping
. But it will be late and the user will lose his collateral that he provided to the rental services. Here we can’t talk about user mistakes since non-technical users, and even technical are not obligated to inspect carefully the contracts and then retrieve their tokens, also when they already bridged their tokens to L2 successfully will means that there are no issues that can arise when tokens are retrieved back on L1.
Loss of funds and blockage of L1 → L2 → L1 bridge due to missing mapping configuration.
Manual Review
Consider setting the L1-to-L2 collections in deposit functions so when tokens are bridged back the original collection address is used.
Likelyhood: High, any collections bridged, without bridge owner action, will be unable to bridge back. Impact: High, L2 -> L1 tokens will be stuck in the bridge. L1 -> L2 will need to ask for a cancellation.
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.