DatingDapp

First Flight #33
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: medium
Valid

Reentrancy Vulnerabilities in SoulboundProfileNFT.mintProfile

  • Root Cause:
    The mintProfile function performs an external call via _safeMint (which may trigger a callback on the recipient) before updating internal state variables (such as recording the token ID in profileToToken and storing profile metadata). This violates the Checks–Effects–Interactions pattern.

  • Impact:
    A malicious receiver contract could exploit the reentrancy possibility to call back into mintProfile (or other functions like burnProfile/blockProfile) before state changes are finalized. This might lead to inconsistent states or unintended multiple profile creations.

  • Recommendation:
    Restructure the function to update all internal state (effects) before performing any external calls (interactions). Alternatively, add a reentrancy guard (using a modifier like OpenZeppelin’s nonReentrant) to protect the function against recursive calls.

Updates

Appeal created

n0kto Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_mintProfile_reentrancy

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`.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.