Under a specific condition, a user can call ThePredicter::register()
twice.
Intuitively, a user should only register once successfully. However, if the following conditions hold, the user can re-register:
The user registers for the first time by calling ThePredicter::register()
and paying the right entrance fee. The user's status is now Status.Pending
.
The registration is approved by the organizer through ThePredicter::approvePlayer()
. The user's status is now Status.Approved
.
After the second step is done, the user can call ThePredicter::register()
for the second time because the function only checks whether the user has a status of Status.Pending
. Since the user's status is now Status.Approved
, the call passes.
The user loses the second entrance fee. This issue does not seem to be exploitable. However, it causes unrecoverable losses to the user if the event occurs.
Testing, manual review.
Consider changing the code on line 55 with the following snippet:
The issue can be demonstrated using the following test:
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.