If users don’t handle ERC721 received, the ERC721 token will be frozen #246
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/main/contracts/src/Cally.sol#L295
https://github.com/code-423n4/2022-05-cally/blob/main/contracts/src/Cally.sol#L344
Vulnerability details
Impact
It doesn't check whether users will handle ERC721 received. If a user is a contract but doesn’t handle ERC721 received, the ERC721 token will be frozen when receiving ERC721 tokens.
Proof of Concept
It doesn’t check whether the receiver has implemented the
onERC721Received
function. If a user buys an option but the user doesn't handle ERC721 received, theERC721(vault.token)
will be frozen after the user exercises the option.Tools Used
vim
Recommended Mitigation Steps
Use
safeTransferFrom
rather thantransferFrom
when transferring ERC721 tokens to users.The text was updated successfully, but these errors were encountered: