The SoulboundProfileNFT contract allows users to mint a soulbound NFT representing their dating profile. If a user is deemed inappropriate, the contract owner can block them via blockProfile()
, which burns their profile NFT and removes associated data. However, because profileToToken[blockAddress]
is reset to 0
, the blocked user can immediately mint a new profile, effectively bypassing the restriction.
The core of the issue lies in the blockProfile()
function. When a user is blocked, the function performs the following steps:
The function removes all traces of the blocked user’s profile, but it does not store any indication that the user was previously blocked. The mapping profileToToken[blockAddress]
is deleted, which resets the condition used to check if a user already has a profile. This allows the user to bypass the restriction in mintProfile()
:
Since profileToToken[msg.sender]
has been reset to 0
after blocking, the require()
condition no longer prevents reminting. This means that a blocked user can immediately call mintProfile()
and create a new dating profile, rendering the blocking mechanism ineffective.
This vulnerability significantly weakens the protocol’s ability to enforce bans. Malicious users, scammers, or banned individuals can:
Create multiple accounts even after being blocked.
Avoid accountability by simply reminting new profiles under a different name.
Engage in repeated bad behavior, making moderation difficult.
manual review
To prevent blocked users from reminting, the protocol should implement a blacklist mapping that permanently records blocked addresses. Modify blockProfile()
as follows:
Modify mintProfile()
to enforce the blacklist:
Likelihood: Low, any blocked users. Impact: High, not really blocked.
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.