The function Soulmate::readMessageInSharedSpace
has a security lack (Access Control). Anyone can read all the messages of soulmates
who own nextID
0
. Since being in a relationship, Partners or soulmates often and might always prefer keep their talks super secure only to them and don't like any disclosure & involvement of a third person in their relationship.
Place the following test code snippet into the test/unit/soulmateTest.t.sol file. Put it at the very bottom but before the last closing semicolon }
.
Open Your Bash Terminal
and execute the following command...
Output should indicate that test Passed Successfully and not reverted anywhere. The anybody can see read messages.
First of all, anyone can read the messages exchanged between soulmates and turn their chats into their own source of entertainment. 😅 However, any unknown person with malicious intentions can social engineer
them and perform a Phishing
attack on soulmates. This bad actor can also Phish
soulmates directly by pretending to be their soulmate and claiming to need money, items, etc., in an emergency.
Foundry Framework (Solidity, Rust)
There should be an if
check to verify whether the person who is trying to read the messages through Soulmate::readMessageInSharedSpace
function, has a soulmate assigned to their nextID
that they own.
Update the src/Soulmate.sol
file with the following code modifications...
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.