Referrer can be referree, which is not aligned with the intention of the referral program and allows referrer to get unintended referreral awards - essentially stealing from the rewards pool.
Proof of Concept
Function referralRegisterTickets only checks that the referrer is != address(0). It does not check that referrer is != referee. Hence, attackers can 'refer' themselves and get the referral rewards.
Lines of code
https://github.com/code-423n4/2023-03-wenwin/blob/91b89482aaedf8b8feb73c771d11c257eed997e8/src/ReferralSystem.sol#L52-L72
Vulnerability details
Impact
Referrer can be referree, which is not aligned with the intention of the referral program and allows referrer to get unintended referreral awards - essentially stealing from the rewards pool.
Proof of Concept
Function
referralRegisterTickets
only checks that the referrer is != address(0). It does not check that referrer is != referee. Hence, attackers can 'refer' themselves and get the referral rewards.Tools Used
Manual review.
Recommended Mitigation Steps
Include a check that referrer is != referee.