Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Invalid

Malicious user can divorce just to prevent other users from getting tokens

Summary

Malicious user can prevent another user from being able to claim tokens by divorcing. Ideally divorce should be a mutul agreement.

Vulnerability Details

getDivorced() function only needs one of the soulmates to prevent both users from being able to claim any tokens.

Impact

Medium. This affects one of the users only if there is malicious intent from one of the soulmates.

Tools Used

Manual analysis

Recommendations

Add a mapping to contain the current divorce status of both soulmates, when both are true, meaning both executed the getDivorced() function then set their divorced mapping status to true.

function getDivorced() public {
address soulmate2 = soulmateOf[msg.sender];
+ wantsDivorce[msg.sender] = true;
+ if(wantsDivorce[soulmate2]) {
divorced[msg.sender] = true;
divorced[soulmateOf[msg.sender]] = true;
emit CoupleHasDivorced(msg.sender, soulmate2);
+ }
}
Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.