sherlock-audit / 2024-08-winnables-raffles-judging

6 stars 2 forks source link

anonimoux2k - Missing validation on minTickets and maxTickets in createRaffle function #610

Closed sherlock-admin3 closed 3 months ago

sherlock-admin3 commented 3 months ago

anonimoux2k

Invalid

Missing validation on minTickets and maxTickets in createRaffle function

Summary

The missing check minTickets <= maxTickets in createRaffle function of WinablesTickerManager.sol contract will cause all raffles with minTickets > maxTickets to have their prizes permanently locked on Ethereum and also not be refunded to players on Avalanche.

Root Cause

No response

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

The missing check above allows the admin to successfully create raffles where minTickets is greater than maxTickets

Impact

Without this constraint check, although the raffle is still successfully created, the player can still purchase tickets normally, but after the ticket purchase stage ends, the raffle cannot move to the draw winner step, which leads to the inability to propagate the winner to WinablesPrizeManager, as well as the inability to cancel the raffle. As a result, the prize will be permanently locked on WinablesPrizeManager, while WinablesTicketManager cannot refund the players.

PoC

No response

Mitigation

Add a constraint between minTickets and maxTickets to ensure that minTickets <= maxTickets

sherlock-admin2 commented 1 month ago

The protocol team fixed this issue in the following PRs/commits: https://github.com/Winnables/public-contracts/pull/1