Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

Airdrop claim will never revert for divorced soulmates

Summary

When a user claims their airdrop using the Airdrop.sol claim() function a check is executed to verify if the soulmate is divorced, this is done using the soulmate contract isDivorced() function which checks the divorced boolean status of msg.sender. The problem is that when performing this call msg.sender is not the user that called the claim() method but the address of the Airdrop.sol contract.

Vulnerability Details

msg.sender doesn't stay the same for external calls inside the function that is called by a user.

Impact

High. Breaks intended functionality for the "divorced" users of the soulmate contract, it never does that revert.

Tools Used

Manual Analysis

Recommendations

Change the isDivorced() functionality to check based on user argument.

- function isDivorced() public view returns (bool) {
+ function isDivorced(address soulmate) public view returns (bool) {
- return divorced[msg.sender];
+ return divorced[soulmate];
}
Updates

Lead Judging Commences

0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-isDivorced-wrong-check

Support

FAQs

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