In order to steals Alice NFT on the Game contract, there's some way to do that:
Step to reproduce:
- This method will need Bob to deploy his own NFT (fake) and mint an NFT with the same id that Alice deposited to the Game contract.
- Then, Bob will transfer his NFT to the Game contract. This action will rewrite the mapping tokenId 10 to Bob's address.
- Next, Bob will call
withdraw
function on the Game contract. This action will success because the validation doing check by comparingoriginalOwner[tokenId] == msg.sender