-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oblivionis - raffle is both drawable and cancelable when currentTicketSold = minTicketsThreshold #126
Comments
escalate not sure why this is invalid. |
The escalation could not be created because you are not exceeding the escalation threshold. You can view the required number of additional valid issues/judging contest payouts in your Profile page, |
escalate |
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
A fixed is desired to perfect the conditional check but it's deemed low given the trivial change needed. |
I'm not sure I understand the medium impact:
Why do you think it shouldn't be a case where you can either cancel or draw the raffle when the min ticket threshold is met? |
Result: |
Escalations have been resolved successfully! Escalation status:
|
The protocol team fixed this issue in the following PRs/commits: |
Oblivionis
Medium
raffle is both drawable and cancelable when currentTicketSold = minTicketsThreshold
Summary
Now there's a game-theory issue in the protocol: a raffle is both drawable and cancelable when
currentTicketSold = minTicketsThreshold
. This issue enables an attacker to force cancel a lottery that should have drawn resultsVulnerability Detail
WinnablesTicketManager.sol
:From the logic above, we can conclude that:
block.timestamp >= raffle.endsAt
, the raffle is both drawable and cancelable.currentTicketSold == minTicketsThreshold
, the raffle is both drawable and cancelable.In terms of game theory, we are in an awkward situation -- A raffle that should have been cancelled can be drawn, a raffle that should have been drawn can be cancelled. This means that an attacker can deprive participants' right to earn a reward by calling
cancelRaffle
.Impact
impact: medium - A raffle that should have been cancelled can be drawn, a raffle that should have been drawn can be cancelled.
likelihood: medium - this situation happens everytime when
currentTicketSold = minTicketsThreshold
.Severity: boardline medium
Code Snippet
https://github.com/sherlock-audit/2024-08-winnables-raffles/blob/main/public-contracts/contracts/WinnablesTicketManager.sol#L434
Tool used
Manual Review
Recommendation
shouldDrawRaffle
andshouldCancelRaffle
should never return true at same time.Duplicate of #26
The text was updated successfully, but these errors were encountered: