CVE-2018-12975 in CryptoSagainfo

Summary

by MITRE

The random() function of the smart contract implementation for CryptoSaga, an Ethereum game, generates a random value with publicly readable variables such as timestamp, the current block's blockhash, and a private variable (which can be read with a getStorageAt call). Therefore, attackers can precompute the random number and manipulate the game (e.g., get powerful characters or get critical damages).

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 03/26/2020

The vulnerability identified as CVE-2018-12975 represents a critical flaw in the cryptographic randomness implementation of the CryptoSaga Ethereum game smart contract. This issue stems from the improper use of pseudo-random number generation mechanisms that rely on predictable blockchain variables. The smart contract's random() function incorporates multiple publicly accessible data points including block timestamps, current blockhash values, and private variables that can be directly queried using Ethereum's getStorageAt RPC call. This design fundamentally undermines the security assumptions of any randomness-dependent game mechanics.

The technical exploitation of this vulnerability occurs through sophisticated precomputation techniques that leverage the deterministic nature of blockchain data. Attackers can monitor the blockchain for upcoming transactions and use the predictable timestamp values, blockhashes, and accessible storage variables to calculate future random numbers before they are actually generated. This allows malicious actors to manipulate game outcomes by knowing the exact random values that will be produced, enabling them to acquire powerful characters, achieve critical damage multipliers, or otherwise gain unfair advantages within the game ecosystem. The vulnerability directly violates the fundamental principles of cryptographic security where random number generation should be unpredictable and resistant to manipulation by external parties.

From an operational perspective, this vulnerability creates severe implications for the integrity of the entire game economy and player experience. The ability to manipulate random outcomes undermines trust in the game's fairness and can lead to significant economic disruption within the game's token economy. Players who discover this vulnerability can systematically exploit it to gain disproportionate advantages, potentially leading to the devaluation of in-game assets and the erosion of competitive balance. The impact extends beyond individual player manipulation to potentially affect the broader Ethereum ecosystem's perception of smart contract security and the reliability of blockchain-based gaming applications.

The vulnerability aligns with CWE-330, which addresses the use of insufficiently random values in cryptographic contexts, and demonstrates clear characteristics of the ATT&CK technique T1059.001 for command and control through blockchain manipulation. The attack surface is particularly concerning as it requires no direct access to private keys or complex cryptographic attacks, but rather leverages the transparent nature of the blockchain itself. Effective mitigations include implementing secure random number generation using verifiable random functions, incorporating external oracle services, or utilizing blockchain features like VRFs (Verifiable Random Functions) that provide cryptographically secure randomness while maintaining the necessary transparency for game operations. Additionally, developers should avoid using predictable blockchain variables such as timestamps and blockhashes in random number generation algorithms, instead adopting more robust cryptographic approaches that ensure true randomness properties.

Reservation

06/28/2018

Disclosure

09/24/2018

Moderation

accepted

CPE

ready

EPSS

0.01253

KEV

no

Activities

very low

Sources

Might our Artificial Intelligence support you?

Check our Alexa App!