Submitted by dingo2077, also found by 0x73696d616f, d3e4, savi0ur, and Blockian
https://github.com/code-423n4/2023-03-wenwin/blob/91b89482aaedf8b8feb73c771d11c257eed997e8/src/Lottery.sol#L135
https://github.com/code-423n4/2023-03-wenwin/blob/91b89482aaedf8b8feb73c771d11c257eed997e8/src/LotterySetup.sol#L114
Attacker can run executeDraw() in Lottery.sol, receive random numbers and then buy tickets with known numbers in one block.
Harm: Jackpot
This vulnerability is possible to use when contract has been deployed with COOLDOWNPERIOD = 0;
The executeDraw() is allowed to be called at the last second of draw due to an incorrect comparison block.timestamp with drawScheduledAt(currentDraw), which is start of draw.
Also modifier in LotterySetup.sol allows same action:
Exploit:
Attacker is waiting for last second of PERIOD (between to draws).
Call executeDraw(). It will affect a requestRandomNumber() and chainlink will return random number to onRandomNumberFulfilled() at RNSourceController.sol.
Attacker now could read received RandomNumber:
Attacker buys new ticket with randomNumber:
Claim winnings:
Exploit code:
VS Code
rand0c0des (Wenwin) confirmed
cccz (judge) decreased severity to Medium 
