{"id":"CVE-2026-74872","aliases":["GHSA-j48q-4c78-rhf9","PYSEC-2026-3742"],"url":"https://o3.security/vulnerability/CVE-2026-74872","summary":"openssl_encrypt before 1.4.0 Arbitrary Code Execution via Whirlpool","details":"## 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.","published":"2026-08-17T11:04:41.525Z","modified":"2026-10-28T02:31:06.740025371Z","cvss":null,"epss":{"score":0.0046,"percentile":0.38982,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"openssl-encrypt","fixedVersion":"1.4.0"}],"fix":{"url":"https://github.com/jahlives/openssl_encrypt/commit/963d0d1278b722ea134272f9df65fddcd3e6ab47","label":"jahlives/openssl_encrypt@963d0d1"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/74xxx/CVE-2026-74872.json"},{"type":"ADVISORY","url":"https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-j48q-4c78-rhf9"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-74872"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/openssl-encrypt-before-arbitrary-code-execution-via-whirlpool"},{"type":"WEB","url":"https://github.com/jahlives/openssl_encrypt/commit/963d0d1278b722ea134272f9df65fddcd3e6ab47"},{"type":"PACKAGE","url":"https://github.com/jahlives/openssl_encrypt"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:31:06.740025371Z"}}