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

fix(story-nft): resolve reentrancy vulnerability #98

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

sebsadface
Copy link
Member

Description

This PR addresses a reentrancy vulnerability in the mint function of the StoryBadgeNFT contract. The issue arises because _safeTransfer invokes the onERC721Received hook, which could potentially re-enter the mint function and bypass the used signature check.

This issue is resolved by moving the _usedSignature[signature] = true update before the _safeTransfer function so that the signature is marked as used before any external calls are made.

@sebsadface sebsadface merged commit 8da160a into storyprotocol:main Oct 16, 2024
3 checks passed
@sebsadface sebsadface deleted the reentrant branch October 16, 2024 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants