The Soulmate contract enables soulmates to mint Soulbound NFTs, share messages in a blockchain-based shared space, and engage in various interactions symbolizing a digital partnership. There's a critical oversight in the writeMessageInSharedSpace
function that allows unauthorized message writing to the shared space of the first minted NFT (ID 0), even by users who do not own any NFT.
The vulnerability arises from the lack of validation in the writeMessageInSharedSpace function. This function uses the ownerToId mapping to determine the NFT ID associated with the caller's address and allows them to write a message to the shared space corresponding to that ID. Since the default value of an uninitialized uint256 in the ownerToId mapping is 0, any address without a corresponding NFT can write a message to the shared space of NFT ID 0. This behavior is unintended and allows for unauthorized message modifications.
This vulnerability compromises the integrity of the shared space, particularly for the first NFT (ID 0), This could lead to spam, offensive content, or unwanted messages being associated with the NFT owned by the initial soulmate pair, undermining the trust and security of the platform.
Manual revision
To mitigate this issue and prevent unauthorized access to the shared space, the contract should include a validation check
This will ensure that user has an NFT (because it has a soulmate), but will be better to use the id 0 as an invalid nft and start the minting ids from 1.
Medium Severity, This has an indirect impact and influence on the possibility of divorce between soulmates owning the first soulmate NFT id0, leading to permanent loss of ability to earn airdrops/staking rewards.
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.