ERC721 TRANSFERFROM() MIGHT LEAD TO USER LOSING FUNDS #277
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L258
https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L318
Vulnerability details
ERC721 TRANSFERFROM() MIGHT LEAD TO USER LOSING FUNDS
In
exercise()
andwithdraw()
, the ERC721transferFrom()
method is used to transfer the premium asset from the contract to the caller. If the caller is a contract that has not implemented theonERC721Received
method properly, the NFT could be locked.Impact
Medium
Proof Of Concept
Instances include:
line 258 and
line 318
Tools Used
Manual Analysis
Recommended Mitigation Steps
use OZ's
safeTransferFrom()
instead ofTransferFrom()
. This way, if someone uses a contract to buy the call option and that contract has not implemented the ERC721 Receiving method properly, theexecute()
function will revert.The text was updated successfully, but these errors were encountered: