openssl-encrypt has non-cryptographic PRNG used for steganography pixel selection
Summary
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.
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.
Recommended Fix
- 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
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.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | openssl-encrypt | < 1.4.0 | 1.4.0 |
References
- https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-vfgx-5q85-58q3
- https://www.vulncheck.com/advisories/openssl-encrypt-before-weak-prng-steganography-pixel-selection
- https://github.com/jahlives/openssl_encrypt/commit/09e96e090417d34d2f533f6810d3cd4f77810101
- https://github.com/jahlives/openssl_encrypt
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:U- Weakness (CWE)
CWE-330- Platform
- Python (PyPI)
- Package
openssl-encrypt- Disclosed
- 31.03.2026
- Updated
- 11.10.2026 15:17
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2026-3754 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-vfgx-5q85-58q3 - CC BY 4.0
Vulnerability history: openssl-encrypt
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 60
- First → latest
- 03.2026 08.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 2
- High 1
- Medium 15
- Unrated 42
Disclosures per year
- 2026: 60
-
openssl-encrypt has non-cryptographic PRNG used for steganography pixel selection this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.