ERC1155Fuse: _transfer
does not revert when sent to the old owner
#179
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
old-submission-method
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-07-ens/blob/ff6e59b9415d0ead7daf31c2ed06e86d9061ae22/contracts/wrapper/ERC1155Fuse.sol#L274-L284
Vulnerability details
Impact
MED - the function of the protocol could be impacted
The
safeTransferFrom
does not comply with the ERC1155 standard when the token is sent to the old owner.Proof of Concept
According to the EIP-1155 standard for the
safeTransferFrom
:Let's say
alice
does not hold any token oftokenId
, andbob
holds one token oftokenId
. Then alice tries to send one token oftokenId
to bob withsafeTranferFrom(alice, bob, tokenId, 1, "")
. In this case, even though alice's balance (= 0) is lower than the amount (= 1) sent, thesafeTransferFrom
will not revert. Thus, violating the EIP-1155 standard.It can cause problems for other contracts using this token, since they assume the token was transferred if the
safeTransferFrom
does not revert. However, in the example above, no token was actually transferred.Tools Used
none
Recommended Mitigation Steps
Revert even if the
to
address already owns the token.The text was updated successfully, but these errors were encountered: