ERC721 Underlying Can Be Stuck in Unsupported Contract #176
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#L295
https://github.com/code-423n4/2022-05-cally/blob/1849f9ee12434038aa80753266ce6a2f2b082c59/contracts/src/Cally.sol#L344
Vulnerability details
Impact
The underlying asset can be transferd out to the caller (
msg.sender
) usingexercise()
orwithdraw()
to the caller indicated bymsg.sender
. If the underlying asset is an ERC721 token, and themsg.sender
is a contract address that does not support ERC721, the underlying asset can be stucked in the contract.As proposed in the EIP-721:
Proof of Concept
This can be indicated manually by the use of
ERC721.transferFrom()
instead ofERC721.safeTransferFrom()
, which includes a safety check for ERC721 support on the destination address.Tool Used
Manual review
Recommended Mitigation Steps
Use
ERC721.safeTransferFrom()
instead which includes a safety check for ERC721 support on the destination address.The text was updated successfully, but these errors were encountered: