Soulmate::mintSoulmateToken
is designed to facilitate the pairing of users with their soulmates. However, due to a flaw in the implementation, it is possible for a user to become their own soulmate, which contradicts the intended functionality and logic of creating interpersonal connections between different participants.
The vulnerability arises from the lack of checks within the mintSoulmateToken
function to prevent a user from being paired with themselves. By calling mintSoulmateToken twice in succession without any intervening action, a user can bypass the intended pairing logic and end up being recorded as their own soulmate. This issue is demonstrated in the provided test code, where user1
successfully becomes their own soulmate after calling mintSoulmateToken
twice:
Allowing users to become their own soulmates undermines the core purpose of the Soulmate contract and can have a number of undesirable effects:
Distorts Contract Logic: The fundamental logic and purpose of the contract are compromised, as the system is designed to foster connections between different users, not self-associations.
A malicious user can generate numerous self-paired soulmates. Creating self-paired soulmates can lead to unwarranted extraction of resources, such as claiming airdrops meant for genuinely paired users. This not only depletes the resources available for legitimate users but also inflates participation metrics, potentially draining the contract's assets.
Manual review.
Include a check that prevents a user from being paired with themselves:
- Given the native anonymous nature of blockchain in general, this issue cannot be avoided unless an explicit whitelist is implemented. Even then we can only confirm soulmates are distinct individuals via kyc. I believe finding a soulmate is intended to be permisionless. - However, even though sufficient (500_000_000e18 in each vault) tokens are minted to claim staking and airdrop rewards, it would take 500_000_000 / 2 combined weeks for airdrop vault to be drained which is not unreasonable given there are [80+ million existing wallets](https://coinweb.com/trends/how-many-crypto-wallets-are-there/). Given there is no option to mint new love tokens, this would actually ruin the functionality of the protocol of finding soulmates and shift the focus to abusing a sybil attack to farming airdrops instead. Assigning medium severity for now but am open for appeals otherwise, since most if not all issues lack indepth analysis of the issue.
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.