Adding the from
parameter to the bridge.cairo::deposit_tokens()
function may result in the theft of NFTs.
The source code of bridge.cairo::deposit_tokens()
is shown below, with emphasis on the // TODO:
part. Currently, from
is set to the caller’s address. However, if from
is changed to a parameter, it means that as long as the from
address has authorized the bridge.cairo
contract to use the NFT, anyone could transfer the NFT to any owner_l1
, leading to potential theft.
Consider the following scenario:
User A authorizes the bridge.cairo
contract to use their NFT.
After User A completes the authorization, Operator B calls bridge.cairo::deposit_tokens()
and uses the from
parameter to help User A complete the cross-chain operation.
(Note: Once User A's authorization transaction is included in a block and successfully submitted to the blockchain, all transaction details (including the authorized NFT and contract address) become public. The transparency of the blockchain ensures that anyone can view this authorization transaction.)
If Operator B fails to act promptly, a malicious User C could call bridge.cairo::deposit_tokens()
to cross-chain the NFT to their own owner_l1
.
If the from
parameter is added to the bridge.cairo::deposit_tokens()
function, it could lead to the theft of NFTs.
Manual Review
It is recommended not to add the from
parameter or similar implementations, and to ensure that the caller's address is always used as from
.
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.