The Soulmate
contains a potential vulnerability in the getDivorced
function. Currently, any user, regardless of whether they have a soulmate or not, can call this function and trigger a divorce. This lack of access control could lead to unintended consequences and abuse. And logically it doesn't make sense that a user who don't have soulmate can get divorce.
The getDivorced
function does not include a check to ensure that the caller has a soulmate before allowing the divorce operation to proceed. As a result, any user can call this function, potentially leading to unauthorized divorces and disrupting the intended functionality of the protocol.
The lack of access control in the getDivorced
function poses several risks:
Unauthorized Divorces: Any user can call the function, even if they do not have a soulmate. This could lead to unauthorized divorces, disrupting the intended relationship management.
Logical issue: It doesn't make any sense that user who don't have a soulmate can get a divorce.
Run the below test and it will pass successfully. Even the soulmate1
has no soulmate, it can get divorce.
Result:
Access Control: Implement access control mechanisms in the getDivorced
function to ensure that only users with a soulmate can initiate a divorce.
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.