ERC20 tokens can be bridged from L2 → L1 due to missing ERC165 validation.
When Bridge::depositTokens
is called it’s verified that the tokens are of type ERC721
and if not bridging is not possible:
The same check is missing in bridge::deposit_tokens
and users can bridge ERC20 tokens and abuse the system. He should only bypass bridge::escrow_deposit_tokens
:
It is possible because transfer_from
has the exact same function signature for both ERC20 and ERC721. The same rule applies to both Starknet and Mainnet. Then on L1 transaction is successfully executed and new ERC721 is deployed with tokenIds for the amount that the user has provided.
ERC20s can be bridged from Starknet to Mainnet due to missing the ERC165
check.
Manual Review
Add functionality that calls the supportInterface
of the NFT
that is going to be bridged.
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.