jsmi - Attacker can cancel raffle when there is exactly minimum participants. #340
Labels
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Medium
A Medium severity issue.
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
jsmi
Medium
Attacker can cancel raffle when there is exactly minimum participants.
Summary
When there is exactly minimum participants, both drawing winner and cancelling raffle are available at the same time.
Attacker can exploit this vulnerability and cancel the raffle.
Vulnerability Detail
When tickets sale period finishes, anyone can call
WinnablesTicketManager.drawWinner()
which in turn calls the following_checkShouldDraw()
to validate some conditions.From
L431
, the sold ticket count should be equal or larger than minimum threshold to start drawing winner.On the other hand, attacker can call
WinnablesTicketManager.cancelRaffle()
which in turn calls the following_checkShouldCancel()
.From
L440
, the sold ticket count should be less or equal than minimum threshold to cancel raffle.As a result, when the sold ticket count is equal to minimum threshold, both drawing winner and canceling raffle are available.
Attacker can cancel the raffle before any other users drawing winner in such a case
Impact
Attacker can cancel raffle when there is exactly minimum participants and this means DoS of core function of contract.
Code Snippet
Tool used
Manual Review
Recommendation
Modify
WinnablesTicketManager._checkShouldDraw()
function as follows.Duplicate of #26
The text was updated successfully, but these errors were encountered: