Skip to content
Heist/ feed
Back to feed
Medium

openssl_encrypt before 1.4.0 Insecure Random Import in PQC Module

Type: advisorySources: OSV

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 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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-74887
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 13:03 UTC · Revision 1

Source evidence

openssl_encrypt before 1.4.0 Insecure Random Import in PQC Module

core-osv · Original source

Published 17 Aug 2026, 11:04 UTC

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 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.

osv:CVE-2026-74887
Complete source record
{
  "id": "9f41ac47becee53ebe6a6418a17eee3b43d2003e7fc897fd6402af8328724e50",
  "url": "https://osv.dev/vulnerability/CVE-2026-74887",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "openssl_encrypt before 1.4.0 Insecure Random Import in PQC Module",
    "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 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.",
    "evidence": "osv:CVE-2026-74887",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-74887",
      "aliases": [
        "CVE-2026-74887",
        "GHSA-cx72-m6xj-3vf6",
        "PYSEC-2026-3745"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/jahlives/openssl_encrypt",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "768df5cd1910e349509f07a27eeac6951e0003bf"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.4.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StandardRange"
                  },
                  {
                    "cpe": "cpe:2.3:a:jahlives:openssl_encrypt:*:*:*:*:*:python:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "1.4.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-74887.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:50.727668777Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/74xxx/CVE-2026-74887.json",
        "https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-cx72-m6xj-3vf6",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-74887",
        "https://www.vulncheck.com/advisories/openssl-encrypt-before-insecure-random-import-in-pqc-module"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-338"
        ],
        "cna_assigner": "VulnCheck",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/74xxx/CVE-2026-74887.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-74887",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 519374,
  "published_at": "2026-08-17T11:04:51.799+00:00"
}