Soulmate::writeMessageInSharedSpace
and Soulmate::readMessageInSharedSpace
allow anyone to read slot linked to id = 0
Soulmate::writeMessageInSharedSpace
and Soulmate::readMessageInSharedSpace
are functions that allows soulmates to write and read a message inserted in a "private" (Anything written in blockchain is visible) slot of the mapping Soulmate::sharedSpace
However, because default value in mapping Soulmate::ownerToId
is 0, anyone who did not call a function that changes its value in Soulmate::ownerToId
will be able to read and write in the slot of ID = 0!
Alters the functionality of the contract for the first couple to get linked
Foundry
Proof of Concept:
1-soulmate1
and soulmate2
call Soulmate::mintSoulmateToken
and get linked, minting the NFT with Id 0. Then soulmate1
calls Soulmate::writeMessageInSharedSpace
writing a message in the slot reserved in Soulmate::SharedSpace
for him and his soulmate (Id = 0).
2- soulmate3
calls Soulmate::readMessageInSharedSpace
and because he never called any function that changes it default value at Soulmate::ownerToId
, it reads the slot for Id =0. Then proceeds to call Soulmate::writeMessageInSharedSpace
writing a message in slot 0 because of the same reason as before.
Adding a check that prevents users without soulmates call that function.
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.