The fallback function of a simple lottery smart contract implementation for Lucky9io, an Ethereum gambling game, generates a random value…
mitre·CWE-338·Published 2018-09-18
The fallback function of a simple lottery smart contract implementation for Lucky9io, an Ethereum gambling game, generates a random value with the publicly readable variable entry_number. This variable is private, yet it is readable by eth.getStorageAt function. Also, attackers can purchase a ticket at a low price by directly calling the fallback function with small msg.value, because the developer set the currency unit incorrectly. Therefore, it allows attackers to always win and get rewards.
The fallback function of a simple lottery smart contract implementation for Lucky9io, an Ethereum gambling game, generates a random value with the publicly readable variable entry_number. This variable is private, yet it is readable by eth.getStorageAt function. Also, attackers can purchase a ticket at a low price by directly calling the fallback function with small msg.value, because the developer set the currency unit incorrectly. Therefore, it allows attackers to always win and get rewards.
La función fallback de una simple implementación de contrato inteligente de lotería para Lucky9io, un juego de apuestas de Ethereum, genera un valor aleatorio con la variable legible públicamente entry_number. Este valor es privado, aunque puede ser leído por la función eth.getStorageAt. Además, los atacantes pueden comprar un ticket a bajo precio llamando directamente a la función fallback con un msg.value pequeño. Esto se debe a que el desarrollador ha establecido la divisa incorrectamente. Por lo tanto, permite que los atacantes ganen siempre y obtengan recompensas.
| Version | Type | Source | Base | Exp | Impact | Vector |
|---|---|---|---|---|---|---|
| 2.0 | Primary | NVD | 5.0 | 10.0 | 2.9 | AV:N/AC:L/Au:N/C:P/I:N/A:N |
| 3.0 | Primary | NVD | 7.5 | 3.9 | 3.6 | CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |