To get the token id for the shared space ownerToId[msg.sender]
is checked. If this entry doesn exist it returns zero. Meaning that because the writeMessageInSharedSpace
function is external anyone who is or isn't a soulmate can call it and write to the sharedSpace with id of 0.
Unset uint variables return 0. Something similar in mappings where an unset mapping that whould return a uint will return 0.
This means that uint256 id = ownerToId[msg.sender];
will result in id being equal to zero when the ownerToId of that msg.sender has not been set, this overwrites the sharedSpace for soulmates that share the nextID of 0 and opens up this shared space for anyone willing to spend some gas to write something there.
High. Incorrect functionality for some users.
Foundry test.
Add an extre check to verify that msg.sender
really is one of the owners of the token.
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.