Description:
A user can burn their profile by calling SoulboundProfileNFT::burnProfile, which results in the user's profile/NFT being burned.
The owner of SoulboundProfileNFT can also block a user's profile by calling SoulboundProfileNFT::blockProfile, which also results in the user's profile/NFT being burned.
The issue is if the user whose profile is being burned or blocked has a user balance with LikeRegistry, then their funds are lost. There's no code to return the funds to the user.
Impact: A loss of funds for users with balances with the contract LikeRegistry when their profile is burned or blocked.
Proof of Concept:
Add the file testLikeRegistry.t.sol to the tests folder and copy the following code into the source file:
Run the block user unit test with verbosity: forge test --mt testBlockProfileLossOfFunds -vvv
The unit test will pass and the following is logged to the screen:
Run the burn user unit test with verbosity: forge test --mt testBurnProfileLossOfFunds -vvv
The unit test will pass and the following is logged to the screen:
Recommended Mitigation: Add a refund function to LikeRegistry.sol. A user can call this function to get their user balance refunded if their profile was burned or blocked.
Likelihood: Low, burning with money in it would be a user mistake, and being blocked is Low. Impact: High, loss of funds
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.