CVE-2019-25157: Improper Access Control (CWE-284)
value: A vulnerability was found in Ethex Contracts. It has been classified as critical. This affects an unknown part of the file EthexJackpot.sol of the component Monthly Jackpot Handler. The manipulation leads to improper access controls. It is possible to initiate the attack remotely. This product does not use versioning. This is why information about affected and unaffected releases are unavailable. The patch is named 6b8664b698d3d953e16c284fadc6caeb9e58e3db. It is recommended to apply a patch to fix this issue. The associated identifier of this vulnerability is VDB-248271.
CWE description: The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.
CVSS v3 base score: 4.3
Published: 2023-12-19T03:15Z
Repository: https://github.com/ethex-bet/ethex-contracts
Language: Other
Files changed: EthexJackpot.sol
Commit date: 2019-06-26 19:38:48 +0000
Commit message: Security vulnerability issue fixed

Issue described here https://bitcointalk.org/index.php?topic=5120151.msg50827730#msg50827730
Diff: diff --git a/EthexJackpot.sol b/EthexJackpot.sol
index c323d94..5b93fac 100644
--- a/EthexJackpot.sol
+++ b/EthexJackpot.sol
@@ -207,22 +207,21 @@ contract EthexJackpot {
         if (monthlyPayAmount > 0)
             getAddress(monthlyWin).transfer(monthlyPayAmount);
         if (seasonalPayAmount > 0)
             getAddress(seasonalWin).transfer(seasonalPayAmount);
     }
-    
+
     function paySuperPrize(address payable winner) external onlyLoto {
         uint256 superPrizeAmount = dailyAmount + weeklyAmount + monthlyAmount + seasonalAmount;
+        dailyAmount = 0;
+        weeklyAmount = 0;
+        monthlyAmount = 0;
+        seasonalAmount = 0;
         emit SuperPrize(superPrizeAmount, winner);
         winner.transfer(superPrizeAmount);
     }
     
-    function loadTickets(address payable[] calldata addresses, uint256[] calldata numbers) external {
-        for (uint i = 0; i < addresses.length; i++)
-            tickets[numbers[i]] = addresses[i];
-    }
-    
     function setOldVersion(address payable oldAddress) external onlyOwner {
         previousContract = EthexJackpot(oldAddress);
         dailyStart = previousContract.dailyStart();
         dailyEnd = previousContract.dailyEnd();
         dailyProcessed = previousContract.dailyProcessed();
@@ -250,11 +249,13 @@ contract EthexJackpot {
         numberEnd = previousContract.numberEnd();
         dailyAmount = previousContract.dailyAmount();
         weeklyAmount = previousContract.weeklyAmount();
         monthlyAmount = previousContract.monthlyAmount();
         seasonalAmount = previousContract.seasonalAmount();
-        firstNumber = numberEnd;
+        firstNumber = weeklyNumberStart;
+        for (uint256 i = firstNumber; i <= numberEnd; i++)
+            tickets[i] = previousContract.getAddress(i);
         previousContract.migrate();
     }
     
     function getAddress(uint256 number) public returns (address payable) {
         if (number <= firstNumber)

Vulnerable code:     
    function loadTickets(address payable[] calldata addresses, uint256[] calldata numbers) external {
        for (uint i = 0; i < addresses.length; i++)
            tickets[numbers[i]] = addresses[i];
    }
    
        firstNumber = numberEnd;
Fixed code: 
        dailyAmount = 0;
        weeklyAmount = 0;
        monthlyAmount = 0;
        seasonalAmount = 0;
        firstNumber = weeklyNumberStart;
        for (uint256 i = firstNumber; i <= numberEnd; i++)
            tickets[i] = previousContract.getAddress(i);