Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The GovNFT:safeTransferMany function its not performing a _safeTransfer #80

Closed
code423n4 opened this issue Dec 12, 2022 · 2 comments
Closed
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-356 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-12-tigris/blob/main/contracts/GovNFT.sol#L245-L249

Vulnerability details

Impact

The function safeTransferMany its not doing a _safeTransfer its just using _transfer

Use of _transfer method for ERC721 is discouraged and recommended to use _safeTransfer
whenever possible by OpenZeppelin.

This is because _transfer cannot check whether the receiving address know how to handle ERC721 tokens. If the recipient is a contract not aware of incoming NFTs, then the transferred NFT would be locked in the recipient forever.

The name of the function is safeTransferMany thats why its expected to do a _safeTransfer

Proof of Concept

Use safeTransferMany to transfer NFT to a contract and you will see that its no triggerin the expected callback hook on the receiver contract.

Tools Used

Manual revision

Recommended Mitigation Steps

Use _safeTransfer instead of _transfer, take in consideration that _safeTransfer will trigger a callback to the receiver, so stick to check - effects - itterarion pattern

Also you havent implemented a _safeTransfer as you do on _transfer GovNFT.sol#L94-L101

@code423n4 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 Dec 12, 2022
code423n4 added a commit that referenced this issue Dec 12, 2022
@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as duplicate of #356

@c4-judge
Copy link
Contributor

GalloDaSballo marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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 duplicate-356 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants