When a user burns their profile or even when a user is blocked, their earnings in the LikeRegistry
contract are lost forever, as no one can withdraw them.
The SoulboundProfileNFT::burnProfile
or SoulboundProfileNFT::blockProfile
functions deletes the user's profile and associated data but does not handle any earnings linked to the profile. This results in locked funds that cannot be accessed by either the protocol or user. In the LikeRegistry::likeUser
, before there can be matches or like, it checks that profileNFT.profileToToken(msg.sender) != 0
, i.e the profile has a token Id associated to them. Deleting a profile in the SoulboundProfileNFT
will make the function revert at those checks since they will be 0. Making funds get locked in the contract forever.
Since there is another vulnerability in the LikeRegistry::likeUser
that does not update user balances, it will be impossible to write codes to prove this. But a scenario can be created.
Consider a user that has gotten many likes and funded about 10 ether.
Then the protocol blocks this user in SoulboundProfileNFT::blockProfile
. No check was made if user has balance in LikeRegistry
.
User tries to like other profile but the transaction reverts since the profile has already been deleted.
These funds are locked in the contract since there is no function to retrieve them.
Loss of user funds.
Reduced trust in the protocol.
Manual code review.
Depending on how the protocol wants to handle unspent funds.
If the protocol wants to takeover balances of users with burnt profiles or users that are blocked, they should transfer the user balance to themselves before completely executing the functions.
If the protocol wants to refund the user, then they should send directly to the user before deleting their profiles.
Here is an implementation to refund user, whereby the LikeRegistry has an emergencyWithdrawBalance
function that can only be called by the SoulboundProfileNFT
. Call the LikeRegistry::emergencyWithdrawBalance
before performing the profile deleting action.
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.