{"id":"CVE-2026-74887","aliases":["PYSEC-2026-3745","GHSA-cx72-m6xj-3vf6"],"title":"openssl_encrypt before 1.4.0 imports Python's non-cryptographic 'random' module (Mersenne Twister PRNG) at line 15 of openssl_encrypt/mod…","summary":"openssl_encrypt before 1.4.0 imports Python's non-cryptographic 'random' module (Mersenne Twister PRNG) at line 15 of openssl_encrypt/modules/pqc.py. No direct calls to random.* were present in the code, so no cryptographic operation is …","severity":"medium","cvss":5.9,"cvssVector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N","vendor":"openssl-encrypt","product":"openssl-encrypt","ecosystem":"pip","affected":["openssl-encrypt < 1.4.0"],"patched":["openssl-encrypt 1.4.0"],"published":"2026-08-17","updated":"2026-09-01","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/PYSEC-2026-3745","references":[{"url":"https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-cx72-m6xj-3vf6"},{"url":"https://www.vulncheck.com/advisories/openssl-encrypt-before-insecure-random-import-in-pqc-module"}],"tags":["osv","pip"],"epss":0.00182,"epssPercentile":0.08091,"ingestedAt":"2026-09-02T19:31:24.754Z","slug":"CVE-2026-74887","body":"## Overview\n\nopenssl_encrypt before 1.4.0 imports Python's non-cryptographic 'random' module (Mersenne Twister PRNG) at line 15 of openssl_encrypt/modules/pqc.py. No direct calls to random.* were present in the code, so no cryptographic operation is currently affected; however, the import creates a hazard that future code could inadvertently use random.randint() instead of a cryptographically secure alternative (secrets/os.urandom), producing predictable values since the Mersenne Twister state can be recovered from approximately 624 outputs. Fixed by removing the import in 1.4.0.\n\n## Affected packages\n\n- `openssl-encrypt < 1.4.0`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `openssl-encrypt 1.4.0`","depth":"sunlit","depthScore":32,"depthScoreParts":{"impact":32.5,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}