The mintProfile
function in the SoulboundProfileNFT
contract fails to enforce age restrictions, allowing users of any age—including minors—to mint a profile. This oversight can result in legal and ethical concerns, particularly in applications involving age-sensitive data, user privacy, and regulatory compliance.
Function: mintProfile(string memory name, uint256 age, string memory profileImage)
Issue: The function does not validate the age
parameter, allowing users to input any arbitrary value, including ages below legal thresholds.
Impact: Underage users can create profiles without restrictions, potentially leading to regulatory non-compliance in jurisdictions with age restrictions on digital identities.
The following test case demonstrates that an underage user (age 10) can successfully mint a profile:
copy and paste this test into the SoulboundProfileNFT.t.sol
and run it
Results
The test passes, confirming that users below a reasonable age threshold can still mint profiles.
Legal & Regulatory Risks: Many jurisdictions enforce age restrictions on digital services. The absence of validation could make the platform non-compliant with laws such as COPPA (Children’s Online Privacy Protection Act) and GDPR (General Data Protection Regulation).
Ethical Concerns: Minors may not fully understand the implications of having a public profile tied to their identity.
Reputation Damage: A system that allows unrestricted age inputs can be exploited, leading to potential backlash from regulators and users.
manual review, foundry and my eyes
Enforce Age Restrictions:
Introduce a minimum age requirement (e.g., 18) before allowing profile minting.
Implement an age
validation check within mintProfile
.
require(age >= 18, "User must be at least 18 years old to mint a profile");
Off-Chain Age Verification:
Integrate third-party identity verification services for age verification before allowing profile minting.
Age Input Validation:
Limit age input to a realistic range (e.g., 18–90) to prevent nonsensical or exploitative values.
Scamming/phishing is not the protocol problem, that's a user mistake. NFT are unique, even if someone does a copy of your profile (which is also possible in web2), I consider it informational. Injection is a problem for the web2 part of the protocol, not a bug here. For the age, it depends on the countries law and future medicine. Anyways, that's more an ethical/political problem, not a bug.
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.