CVE-2026-122093 in Strong::Random
Summary
by MITRE • 11/25/2026
Strong::Random versions through 0.96 for Perl allow every later rand output to be predicted from three earlier ones.
The generator keeps its state in a single number. Each call multiplies the state by a factor derived from it, and the returned digits encode that factor, so three consecutive outputs determine the state however the generator was seeded. Outputs are also biased: the first digit after the decimal point is never zero, so rand(256) never returns 1 to 24.
An attacker who sees three consecutive outputs can predict the tokens, passwords or key bytes that the same object later issues to other users.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 11/27/2026
The vulnerability in Strong::Random versions through 0.96 for Perl represents a critical failure in cryptographic randomness generation due to fundamental flaws in its internal state management and output encoding mechanisms. The core technical flaw lies in the generator's reliance on a single numerical value to maintain its entire state, combined with a deterministic linear congruential-like transformation where each call multiplies this state by a factor derived from itself. This design choice creates a mathematically reversible relationship between consecutive outputs. Specifically, because the returned digits encode information about the multiplicative factor used in that step, an observer can reverse-engineer the internal state if they possess sufficient output data. The vulnerability is not merely theoretical; it allows for complete prediction of all future random values based on just three prior observations, regardless of how the generator was initially seeded or what initial entropy was provided during instantiation.
From a technical perspective, this flaw maps directly to CWE-330: Use of Insufficiently Random Values and CWE-182: Collapse of Data into Unexpected State. The algorithm fails to meet the requirements for Cryptographically Secure Pseudo-Random Number Generators (CSPRNGs), which mandate that past outputs should not reveal any information about future or previous states, even if some internal state is exposed. In this implementation, the leakage occurs because the output digits are not sufficiently masked from the underlying mathematical transformation. The deterministic nature of the multiplication and encoding process means that three consecutive outputs provide enough entropy to solve for the unknown initial seed and subsequent multipliers. This effectively reduces a complex cryptographic primitive into a simple linear equation system that can be solved with minimal computational effort, rendering any security mechanism relying on this module for token generation, session IDs, or key derivation completely insecure.
The operational impact of this vulnerability is severe, particularly in applications where Strong::Random was used to generate sensitive authentication materials such as one-time passwords (OTPs), CSRF tokens, API keys, or encryption keys. An attacker who can intercept three consecutive random values generated by the vulnerable module—whether through log files, network traffic analysis, or side-channel observations on a shared server environment—can reconstruct the internal state of the generator. Once the state is known, the attacker can predict all future outputs with certainty. This allows for unauthorized access to user accounts by guessing session tokens, bypassing security controls that depend on unpredictable identifiers, or decrypting communications if weak keys were derived from these random values. The bias in the output further complicates mitigation efforts through simple statistical analysis but does not prevent state recovery; notably, the first digit after the decimal point never being zero creates a non-uniform distribution where rand(256) cannot return values between 1 and 24 inclusive, which is another indicator of poor randomness quality mapping to CWE-338.
This vulnerability aligns with MITRE ATT&CK technique T1078: Valid Accounts if used for session hijacking or T1557: Adversary-in-the-Middle if the predicted tokens are used to intercept and manipulate communications. The predictability of the random number generator undermines the confidentiality and integrity guarantees expected from security protocols. To mitigate this risk, organizations must immediately replace instances of Strong::Random with modules that implement proven CSPRNG algorithms such as those based on /dev/urandom or OpenSSL's RAND_bytes function in Perl environments. Developers should audit codebases for any usage of this module in contexts requiring unpredictability and ensure that no logs or error messages expose the raw output values generated by these functions, although remediation requires source code changes rather than just log masking due to the deterministic nature of the flaw.