Due to incorrect implementation of verification logic for collection addresses while withdrawing, NFTs will get locked forever
L1 <-> L2 mappings are updated with newly deployed ERC721 bridgable contract addresses if it is the first token of a collection. But as these mappinps would only be updated on the withdraw functions, it leaves the mapping from where the tokens are deposited unset. This would result in error while verifying collections address while calling withdraw
Lets say alice PLAY is a new whitelisted collection on L1
Alice bridges PLAY #20 to bob. This is the first token being bridged of this collection.
As _l1ToL2Addresses[PLAY] returns 0 address, there will be corresponding bridgeable collection will be deployed. Lets call it PLAY_ON_L2
Now the mapping on L2 will be updated as
l1_to_l2_addresses[PLAY, PLAY_ON_L2]
l2_to_l1_addresses[PLAY_ON_L2, PLAY]
But still on L1 side there is no update on mappings
Now bob gets minted PLAY_ON_L2 #50. He tries to bridge it back to alice
While alice tries to call withdrawTokens on L1
The mappings and request would be
req.collectionL1 = PLAY
req.collectionL2 = PLAY_ON_L2
l1Mapping = 0x00
l2Mapping = 0x00
If both req.collectionL1 and req.collectionL2 are non zero and if l1Mapping is not equal to req.collectionL1, verification would revert.
This would lock the NFTs in L2 bridge
Similar issue is present in verify_collection_address
in L2 bridge
Users will loose NFTs forever
Manual review
Simplify verification logic. Remove strict checks if both l1 req and l2 req are present because they are set in bridge contracts which are trusted. Also consider using only one mapping in each bridge contract which just stores if a collection is already deployed
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.