Description
The function SoulboundProfileNFT::mintProfile
doesn't follow CEI pattern as it updates the state at the very end, allowing reentrancy due to the external call made in ERC721::_safeMint
.
Impact
Malicious users can create a smart contract that implements checkOnERC721Received()
that reenters the function SoulboundProfileNFT::mintProfile
.
Proof of Concepts
Add the following contract and test to testSouldboundProfileNFT.t.sol
:
Recommended mitigation
Add the following changes to SoulboundProfileNFT::mintProfile
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.