CVE-2010-1128 in PHPinfo

Summary

by MITRE

The Linear Congruential Generator (LCG) in PHP before 5.2.13 does not provide the expected entropy, which makes it easier for context-dependent attackers to guess values that were intended to be unpredictable, as demonstrated by session cookies generated by using the uniqid function.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 05/03/2026

The vulnerability identified as CVE-2010-1128 resides in the PHP scripting language's implementation of the Linear Congruential Generator algorithm used for generating pseudo-random numbers. This weakness affects PHP versions prior to 5.2.13 and specifically impacts the entropy quality of random number generation, creating predictable sequences that can be exploited by malicious actors. The issue manifests through the uniqid function which relies on the flawed LCG implementation, making session cookies and other security-sensitive values vulnerable to prediction attacks. The vulnerability represents a fundamental weakness in the cryptographic randomness implementation that undermines the security of applications relying on PHP's built-in random number generation capabilities.

The technical flaw stems from the mathematical properties of the Linear Congruential Generator algorithm itself, which generates sequences using a simple recurrence relation. When the parameters of this generator are poorly chosen or when the seed values are predictable, the resulting sequence becomes highly susceptible to prediction attacks. In PHP's case, the implementation did not adequately address these mathematical weaknesses, leading to a situation where the random number generation process produces sequences with insufficient entropy. This characteristic makes it possible for attackers to reverse-engineer the generator state and predict future outputs, particularly when they can observe or influence the generation process. The vulnerability is classified under CWE-330 as the use of insufficiently random values, which directly impacts the security of cryptographic functions and random number generation.

The operational impact of this vulnerability extends beyond simple predictability issues, as it directly compromises the security of session management systems that depend on unique identifiers. When session cookies are generated using the vulnerable uniqid function, attackers can potentially predict future session identifiers and perform session hijacking attacks. This weakness is particularly dangerous in web applications where session management relies on unpredictable identifiers, as it allows attackers to impersonate legitimate users and gain unauthorized access to protected resources. The vulnerability also affects any application components that depend on PHP's random number generation for security purposes, including password generation, token creation, and cryptographic key derivation processes. The context-dependent nature of the attack means that successful exploitation requires knowledge of the system state or the ability to observe the random number generation process, but once achieved, it can lead to complete session compromise and unauthorized access.

Mitigation strategies for CVE-2010-1128 primarily focus on upgrading to PHP versions 5.2.13 or later where the LCG implementation has been improved to provide better entropy characteristics. Organizations should also implement additional security measures such as using more robust random number generation functions like openssl_random_pseudo_bytes or /dev/urandom when available, and ensuring that session management systems do not rely solely on predictable identifiers. The vulnerability demonstrates the critical importance of proper random number generation in cryptographic systems and aligns with ATT&CK technique T1583.001 for obtaining credentials and T1078.004 for valid accounts, as compromised session identifiers can lead to unauthorized access and credential theft. Security practitioners should also consider implementing monitoring for predictable patterns in generated identifiers and conduct regular vulnerability assessments to identify similar weaknesses in other components of their application stack.

Reservation

03/26/2010

Disclosure

03/26/2010

Moderation

accepted

Entry

VDB-52401

CPE

ready

Exploit

Download

EPSS

0.07873

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!