Summary
The mintProfile() function uses _safeMint(), which calls the recipient’s address if it's a contract. This can allow an attacker to perform a reentrancy attack, potentially manipulating _nextTokenId to mint multiple NFTs before it updates correctly.
The _safeMint() function triggers the onERC721Received() callback in contracts.
If an attacker creates a malicious contract that re-calls mintProfile() inside onERC721Received(), they can mint multiple NFTs before _nextTokenId updates correctly.
This results in incorrect token indexing and potential duplication of profile NFTs.
⦁ Multiple NFTs could be assigned to a single user, violating the soulbound nature of the token.
⦁ Attackers could manipulate the token index, breaking the integrity of the contract.
⦁ Could cause inconsistencies in profile mappings, leading to undefined behavior.
Manual review
Update _profiles and profileToToken before minting the nft:
Likelihood: High, anyone can do it. Impact: Low, several profile will be minted, which is not allowed by the protocol, but only the last one will be stored in profileToToken and won't affect `likeUser` or `matchRewards`.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.