erc721_bridgeable::mint_from_bridge(...)
function uses _mint
instead of _safe_mint
, tokens will be locked for contracts that cannot handle them i.e, that don't support the IERC721Receiver
interface.
starknet/src/token/erc721_bridgeable.cairo#L78-L93
The problem is that _mint
does not check if to
(i.e req.owner_l2
) can handle ERC721 tokens, which is used in Bridge::withdraw_tokens(...)
to withdraw tokens from the bridge:
starknet/src/bridge.cairo#L165-L169
If req.ownerL2
is a smart contract that does not implement IERC721Receiver
, tokens will be locked in the bridge. Same goes for tokens in the solidity
contract (We understand token/ERC721Bridgeable.sol
is OOS, but it affects within-scope logic that could lock tokens).
For context on how is _mint
different from _safeMint
, see ERC721/ERC721.sol#L226-L238 & ERC721/ERC721.sol#L252-L286.
Tokens locked.
Manual review.
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.