{"id":"CVE-2026-74872","aliases":["CVE-2026-74872","GHSA-j48q-4c78-rhf9","PYSEC-2026-3742"],"related":[],"kind":"vulnerability","state":"published","title":"openssl_encrypt before 1.4.0 Arbitrary Code Execution via Whirlpool","summary":"openssl_encrypt versions before 1.4.0 contain an arbitrary code execution vulnerability in the Whirlpool hash implementation that uses broad glob patterns to load .so modules without integrity verification. Attackers can place malicious .so files matching the whirlpool*py313*.so pattern in site-packages directories to achieve native code execution when the module is loaded.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"openssl_encrypt versions before 1.4.0 contain an arbitrary code execution vulnerability in the Whirlpool hash implementation that uses broad glob patterns to load .so modules without integrity verification. Attackers can place malicious .so files matching the whirlpool*py313*.so pattern in site-packages directories to achieve native code execution when the module is loaded.","source":"cvelist"},{"lang":"en","text":"## Severity: HIGH\n\n### Summary\n\nThe Whirlpool hash implementation in `openssl_encrypt/modules/registry/hash_registry.py` at **lines 570-589** uses glob patterns to find `.so` modules in site-packages and loads the first match via `importlib` without verifying module integrity.\n\n### Affected Code\n\n```python\nfor site_pkg in site.getsitepackages():\n    pattern = os.path.join(site_pkg, \"whirlpool*py313*.so\")\n    py313_modules = glob.glob(pattern)\n    if py313_modules:\n        module_path = py313_modules[0]  # Takes first match\n        loader = ExtensionFileLoader(\"whirlpool\", module_path)\n        spec = importlib.util.spec_from_file_location(\"whirlpool\", module_path, loader=loader)\n        whirlpool_module = importlib.util.module_from_spec(spec)\n        spec.loader.exec_module(whirlpool_module)\n```\n\n### Impact\n\nThe glob pattern `\"whirlpool*py313*.so\"` is broad and takes the first match without verifying:\n- File hash/signature\n- File ownership/permissions\n- Whether it's a legitimate module\n\nIf an attacker can place a malicious `.so` file matching this pattern in any site-packages directory, it will be loaded and native code executed.\n\n### Recommended Fix\n\n- Verify the module's integrity (hash or signature) before loading\n- Use a specific filename rather than a glob pattern\n- Check file permissions and ownership\n\n### Fix\n\nFixed in commit `963d0d1` on branch `releases/1.4.x` — added os.path.realpath() to resolve symlinks and validation that found .so files are within known site-packages directories before loading.","format":"markdown","source":"ghsa"}],"published":"2026-03-31T23:31:29.000Z","modified":"2026-10-08T16:17:38.797Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":9.3,"rating":"CRITICAL"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/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:H/VA:H/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-426","CWE-427"],"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-j48q-4c78-rhf9","tags":["advisory","mitigation","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.vulncheck.com/advisories/openssl-encrypt-before-arbitrary-code-execution-via-whirlpool","tags":["advisory","third-party-advisory"],"sources":["cvelist","nvd","pysec"]},{"url":"https://github.com/jahlives/openssl_encrypt/commit/963d0d1278b722ea134272f9df65fddcd3e6ab47","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":"total","date":"2026-08-18T14:35:28.607Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-74872","url":"https://www.cve.org/CVERecord?id=CVE-2026-74872","licence":"CVE Terms of Use","modified":"2026-10-08T15:24:47.699Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j48q-4c78-rhf9","url":"https://github.com/advisories/GHSA-j48q-4c78-rhf9","licence":"CC-BY-4.0","modified":"2026-09-01T09:25:19.420Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-74872","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-74872","licence":"Public domain","modified":"2026-10-08T16:17:38.797Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3742","url":"https://osv.dev/vulnerability/PYSEC-2026-3742","licence":"CC-BY-4.0","modified":"2026-09-01T09:15:03.518Z"}],"updatedAt":"2026-11-25T22:59:33.331Z","epss":{"score":0.0046,"percentile":0.41574,"date":"2026-12-01T12:00:22.000Z"}}