Attack on Pseudo-random number... CVE-2018–12454

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

### Abstract An Ethereum lottery game, 1000 Guess, has a vulnerability that it generates random numbers predictable by anyone. This game decides a winner by a random number when the number of players who bet on the contract reaches to the predetermined number. The contract generates the random number using sha256() function with a private variable and the current block variables, such as block.timestamp, block.coinbase and block.difficulty. However, they are easily readable. First, a private variable is easily accessible by using web3.eth.getStorageAt. Second, it is well known that block variables can be easily manipulated by malicious miners. However, it will be also dangerous even though attackers are not miners. In this article, I will explain how to attack PRNG by using internal transactions. ### Details ![](https://images.seebug.org/1531118402998-w331s) Figure 1. 1000 guess generates a random number with block variables and a private variable 1000 Guess generates a random...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息