In the Soulmate protocol, only a user who already has a soulmate could divorce. However, it has been discovered that a user can be in a divorced state without ever having had a soulmate.
The lack of verification in Soulmate::getDivorced
regarding whether a user currently has a soulmate could result in a situation where a user can be divorced if the function is called, regardless of whether the user has a valid soulmate or not.
The following PoC can be added to SoulmateTest.t.sol
to verify this.
The impact of this vulnerability is LOW. According to the protocol description, 'Soulmate::getDivorced' offers no way to undo this action. Once a user is in the divorced state, it is permanent, and the user can no longer receive airdrops. Hence, it is important to ensure that a user cannot accidentally enter a divorced state by mistake.
Foundry
When a user calls Soulmate::getDivorced
, it is essential to check that the user has a valid soulmate. A custom error, error Soulmate__doesNotHaveASoulmate()
, could be defined and used for this purpose.
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.