Access Control, leading to a loss of funds
Description:
The Airdrop::claim
function doesn't have any access control mechanism and this fact allied with a protocol logic allows a malicious actor to steal money from the participants. see the code below:
Impact:
Allows malicious actors to steal LoveToken
from the participants.
Proof of Code:
Soulmate1 and Soulmate2 mint the soulmate NFT
They let the Airdrop accumulate for 200 days
Then somebody sees and claims with a wallet that doesn't participate in the protocol.
This somebody will be considered the owner of the token[0] and will be able to claim the rewards.
Recommendation:
Add a check to limit access to soulmates only
High severity, This issue is separated from the flawed `isDivorced()` check presented in issue #168 as even if that is fixed, if ownership is not checked, isDivorced would still default to false and allow bypass to claim airdrops by posing as tokenId 0 in turn resulting in this [important check for token claim is bypassed.](https://github.com/Cyfrin/2024-02-soulmate/blob/b3f9227942ffd5c443ce6bccaa980fea0304c38f/src/Airdrop.sol#L61-L66). #220 is the most comprehensive issue as it correctly recognizes both issues existing within the same function.
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.