The mintProfile
function in the SoulboundProfileNFT
contract does not validate the profileImage
URL provided by the user. This lack of validation allows attackers to input arbitrarily large URLs, leading to excessive storage consumption on-chain. The test testStorageAttackWithDifferentAttackers
demonstrates that attackers can mint profiles with extremely large image URLs (e.g., 100MB), causing the contract to run out of memory (MemoryOOG error). This results in a denial of service (DoS) for legitimate users.
Severity: High
Denial of Service (DoS): Attackers can repeatedly store large profile image URLs, exhausting contract storage and making it impossible for other users to interact with the contract.
Increased Gas Costs: Processing and storing large image URLs significantly increases gas costs, making minting prohibitively expensive.
Chain Bloat: Unrestricted storage usage leads to unnecessary blockchain state growth, increasing the long-term cost of maintaining the network.
copy and paste this test into testSoulboundProfileNFT.t.sol
Test Result:
Manual review and foundry
Implementing strict URL validation, length & image size constraints and off-chain storage solutions can mitigate this vulnerability and prevent a storage-based DoS attack.
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.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
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.