The SoulboundProfileNFT
contract contains a reentrancy vulnerability that allows users to mint multiple NFTs. This issue arises because the mappings are updated after the minting process, and users can burn their own profile to mint a new one repeatedly. This allows users to bypass the restriction of having only one profile NFT.
In the mintProfile
function, the mappings profileToToken
and _profiles
are updated after the minting process. This allows a reentrancy attack where a user can mint multiple NFTs by burning their profile and minting a new one repeatedly.
Denial of Service (DoS): If a malicious user mints all possible NFTs, new users will not be able to register, leading to a denial of service.
Loss of Trust: The ability to mint multiple NFTs undermines the integrity of the platform and can lead to a loss of trust among users.
Potential Financial Loss: The platform may suffer financial losses due to the exploitation of this vulnerability.
Manual code review
1 - First create the contract that will receive the NFT's.
2 - Implement the following test function.
3 - This test will fail because the assertion is not met. During testing, i successfully minted 8,691 NFTs, but this process can be repeated until all possible NFTs are minted.
Use Reentrancy Guard: Implement a reentrancy guard to prevent reentrancy attacks. The OpenZeppelin ReentrancyGuard
can be used for this purpose.
Use CEI pattern: Update the mappings profileToToken
and _profiles
before the minting process to prevent reentrancy attacks.
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.