Description: Due to the weakness in randomness, malicious users may be able to predict the sequence or content of messages that will be displayed from the Soulmate::niceWords
array.
Impact: This vulnerability presents a considerable threat, allowing malicious users the potential to forecast the order of messages showcased from the Soulmate::niceWords
array. As a result, the sanctity and privacy of the shared space, where sensitive messages is exchanged, stand at risk of compromise. This jeopardizes user privacy and trust, potentially leading to breaches of confidentiality.
Proof of Concept:
A couple each mint a token with each other through the Soulmate::mintSoulToken
function thus making them registered Soulmates with the Soulmate
token.
One of the soulmate partner writes to a corresponding soulmate partner via the Soulmate::writeMessageInSharedSpace
function whereby the message is saved in the Soulmate::sharedSpace
mapping.
The malicious user discovers the randomness issue and exploits it by using a couple of fuzz runs to adjust the variable block.timeStamp
and to call the Soulmate::readMessageInSharedSpace
function in order to get some expected message.
The malicious user retrieves and logs the expected message returned by the function, exploiting the vulnerability to access private messages between registered Soulmate
token couples.
Place the following into the SoulmateTest.t.sol
.
Recommended Mitigation: Use external sources of randomness via oracles like Chainlink VRF.
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.