{"id":"CVE-2026-74874","aliases":["CVE-2026-74874","GHSA-vfgx-5q85-58q3","PYSEC-2026-3754"],"related":[],"kind":"vulnerability","state":"published","title":"openssl_encrypt before 1.4.0 Weak PRNG Steganography Pixel Selection","summary":"openssl_encrypt versions before 1.4.0 use Python's non-cryptographic random module for steganographic pixel selection in the generate_pseudorandom_sequence function. Attackers who know the password can recover the Mersenne Twister state from approximately 624 outputs and predict pixel locations containing hidden data for extraction.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"openssl_encrypt versions before 1.4.0 use Python's non-cryptographic random module for steganographic pixel selection in the generate_pseudorandom_sequence function. Attackers who know the password can recover the Mersenne Twister state from approximately 624 outputs and predict pixel locations containing hidden data for extraction.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe `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.\n\n### Affected Code\n\n```python\nrandom.seed(seed)\nsequence = random.sample(range(max_value), min(length, max_value))\nreturn sequence\n```\n\nAdditionally, 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.\n\n### Impact\n\nThe 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.\n\n### Recommended Fix\n\n- Use HMAC-DRBG or `secrets` module for cryptographically secure pixel selection\n- Use full 32-byte SHA-256 output as seed material\n- Store the password in `SecureBytes` instead of a plain string\n\n### Fix\n\nFixed 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.","format":"markdown","source":"ghsa"}],"published":"2026-03-31T23:43:06.000Z","modified":"2026-10-08T16:17:39.117Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","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","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","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","score":8.7,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","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","rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","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:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"}],"cwes":["CWE-330","CWE-338"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.4.0","status":"affected"},{"type":"semver","version":"1.4.0","status":"unaffected"}],"vendor":"jahlives","product":"openssl_encrypt","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.4.0"}],"ecosystem":"PyPI","package":"openssl-encrypt","purl":"pkg:pypi/openssl-encrypt","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.4.0"}],"vendor":"jahlives","product":"openssl_encrypt","cpe":"cpe:2.3:a:jahlives:openssl_encrypt:*:*:*:*:*:python:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.4.0"}],"ecosystem":"PyPI","package":"openssl-encrypt","purl":"pkg:pypi/openssl-encrypt","source":"pysec"}],"references":[{"url":"https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-vfgx-5q85-58q3","tags":["advisory","mitigation","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.vulncheck.com/advisories/openssl-encrypt-before-weak-prng-steganography-pixel-selection","tags":["advisory","third-party-advisory"],"sources":["cvelist","nvd","pysec"]},{"url":"https://github.com/jahlives/openssl_encrypt/commit/09e96e090417d34d2f533f6810d3cd4f77810101","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/jahlives/openssl_encrypt","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-08-17T15:44:44.405Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-74874","url":"https://www.cve.org/CVERecord?id=CVE-2026-74874","licence":"CVE Terms of Use","modified":"2026-10-08T15:24:48.734Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vfgx-5q85-58q3","url":"https://github.com/advisories/GHSA-vfgx-5q85-58q3","licence":"CC-BY-4.0","modified":"2026-09-02T09:10:33.726Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-74874","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-74874","licence":"Public domain","modified":"2026-10-08T16:17:39.117Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3754","url":"https://osv.dev/vulnerability/PYSEC-2026-3754","licence":"CC-BY-4.0","modified":"2026-09-02T09:00:04.184Z"}],"updatedAt":"2026-11-25T22:59:33.331Z","epss":{"score":0.00255,"percentile":0.18174,"date":"2026-12-01T12:00:22.000Z"}}