-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use safeTransferFrom instead of transferFrom for ERC721 transfers #38
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
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Comments
code423n4
added
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
labels
May 11, 2022
This was referenced May 15, 2022
outdoteth
added
the
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
label
May 16, 2022
This was referenced May 16, 2022
Open
Open
Open
Open
Open
This was referenced May 16, 2022
Closed
the fix for this issue is here; outdoteth/cally#4 |
outdoteth
added
the
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
label
May 17, 2022
This was referenced May 25, 2022
This was referenced Jun 6, 2022
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
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
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
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#L199
https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L295
https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L344
Vulnerability details
Details & Impact
The
transferFrom()
method is used instead ofsafeTransferFrom()
, presumably to save gas. I however argue that this isn’t recommended because:transferFrom()
, usesafeTransferFrom()
whenever possibleonERC721Received()
function, which is only triggered in thesafeTransferFrom()
function and not intransferFrom()
Recommended Mitigation Steps
Call the
safeTransferFrom()
method instead oftransferFrom()
for NFT transfers. Note that theCallyNft
contract should inherit theERC721TokenReceiver
contract as a consequence.The text was updated successfully, but these errors were encountered: