docs icon indicating copy to clipboard operation
docs copied to clipboard

Possible Vulnerability in Example Smart Contract

Open theobayard opened this issue 4 years ago • 0 comments

The implementation of the LiquidityExamples smart contract implements onERC721Received here in a way that I believe causes a vulnerability. I haven't had time to test this yet, but it appears as though one could wait for someone to call this function and then immediately call it again with the same input except replacing operator with their own address. This would cause the owner variable to be overwritten and allow the attacker to withdraw the NFT or the liquidity associated with it.

theobayard avatar Nov 08 '21 17:11 theobayard