Summary
openssl-encrypt has non-cryptographic PRNG used for steganography pixel selection
The generate_pseudorandom_sequence() function in openssl_encrypt/plugins/steganography/core/utils.py at lines 89-91 uses Python's random module (Mersenne Twister) for steganographic pixel/sample selection.
Affected Code
random.seed(seed)
sequence = random.sample(range(max_value), min(length, max_value))
return sequence
Additionally, the steganography password is stored as a plain Python string (not SecureBytes) and only 8 bytes (64 bits) of the SHA-256 hash are used for the seed, reducing effective security to 64 bits.
Fix
Fixed in commit 09e96e0 on branch releases/1.4.x, replaced random.seed(hash(password)) with HMAC-SHA256 based CSPRNG (Fisher-Yates shuffle) and numpy Generator with HMAC-derived seeds across all steganography format modules.
Impact
The Mersenne Twister's state can be recovered from approximately 624 outputs. An attacker who knows or guesses the password can predict the PRNG sequence and determine exactly which pixels contain hidden data, potentially extracting the hidden data without the password.
Security-sensitive operations rely on values that are predictable or insufficiently random. Typical impact: forged tokens, guessable identifiers, or broken cryptographic protocols.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
- Use HMAC-DRBG or
secretsmodule for cryptographically secure pixel selection - Use full 32-byte SHA-256 output as seed material
- Store the password in
SecureBytesinstead of a plain string
Frequently Asked Questions
- What is GHSA-VFGX-5Q85-58Q3? GHSA-VFGX-5Q85-58Q3 is a medium-severity use of insufficiently random values vulnerability in openssl-encrypt (pip), affecting versions < 1.4.0. It is fixed in 1.4.0. Security-sensitive operations rely on values that are predictable or insufficiently random.
- Which versions of openssl-encrypt are affected by GHSA-VFGX-5Q85-58Q3? openssl-encrypt (pip) versions < 1.4.0 is affected.
- Is there a fix for GHSA-VFGX-5Q85-58Q3? Yes. GHSA-VFGX-5Q85-58Q3 is fixed in 1.4.0. Upgrade to this version or later.
- Is GHSA-VFGX-5Q85-58Q3 exploitable, and should I be worried? Whether GHSA-VFGX-5Q85-58Q3 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-VFGX-5Q85-58Q3 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-VFGX-5Q85-58Q3? Upgrade
openssl-encryptto 1.4.0 or later.