-
Notifications
You must be signed in to change notification settings - Fork 3
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
Re-entry vulnerability in the burnToMint function #645
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-411
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Comments
c4-submissions
added
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
labels
Nov 9, 2023
141345 marked the issue as duplicate of #1198 |
141345 marked the issue as duplicate of #1597 |
141345 marked the issue as duplicate of #1742 |
alex-ppg marked the issue as not a duplicate |
alex-ppg marked the issue as duplicate of #90 |
alex-ppg marked the issue as unsatisfactory: |
c4-judge
added
the
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
label
Dec 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-411
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/NextGenCore.sol#L213-L232
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/ERC721.sol#L407
Vulnerability details
Impact
When executing the burnToMint function, an attacker can reenter so that only one NFT is burned and thus mint multiple NFTs.
Since the check of the _isApprovedOrOwner function is at L215, the _mintProcessing function is at L218, and the _burn function is at L219, the user reenters the call to this function via the _checkOnERC721Received function in the _mintProcessing function, and the NFTs are still not yet burn. The NFT is still not burn and the user can continue to mint.
Finally, the same NFT is burned multiple times, but does not generate an error, so it is able to reenter successfully.
Proof of Concept
Tools Used
manual
Recommended Mitigation Steps
It is recommended that burn be executed before mint
Assessed type
Reentrancy
The text was updated successfully, but these errors were encountered: