tokenURI builds on-chain JSON metadata from the profile name, age and image.
name and profileImage are user input and are concatenated into the JSON without escaping. A name containing " can close the string and add or override keys (e.g. a fake description, extra attributes, or a different image). Marketplaces and front-ends that render this metadata show attacker-controlled fields as if they came from the protocol.
Example: minting with the name x", "description":"Verified by DatingDapp team produces
Many JSON parsers keep the first duplicate key, so the fake description is what users see.
Likelihood:
Any user can choose their name and image when minting; no privileges needed.
Impact:
Spoofed metadata (fake verification text, fake attributes, swapped image) enables impersonation and phishing on a dating platform; broken JSON for names containing quotes or backslashes. No direct fund loss.
Test setup: owner deploys SoulboundProfileNFT and LikeRegistry(address(nft)); alice, bob, carol each get 10 ETH and mint a profile (token ids 1, 2, 3). Full file test/AuditPoC.t.sol, forge test --mc AuditPoC passes.
Validate or escape user strings before building JSON:
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.