If the admin changes the L1 <-> L2
mapping on L1, not-yet withdrawn NFTs cannot be withdrawn.
The mapping for L1 to L2 collections on L1 dictates to which collection a L2 -> L1 bridged NFT belongs. If a request's destination collection is non-zero and does not match the one in the mapping, this NFT can not be withdrawn because _verifyRequestAddresses
called by withdrawTokens
will revert:
As we see at [1]
and [2]
, if there is a mismatch, the transaction gets reverted. Now this is a problem because the mapping can change and if this transaction reverts, the NFT is stuck as it is impossible to cancel a L2 -> L1
bridging.
Now let's assume the following scenario:
A collection is deployed on L1 and L2 -> mappings are set
User bridges NFT from L2 to L1 -> destination collection is non-zero
User does not withdraw the NFT yet and leaves it in the bridge
An admin changes the mapping on L1 (for whatever reason)
User can not withdraw their NFT anymore because any calls to withdrawTokens
revert
The impact of this is loss of NFTs as described above.
Manual review
Consider one of the following:
Not allowing mapping changes if NFTs of that collection are held in the bridge
Allowing withdrawals even if the mapping does not match the request
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.