{"id":"GHSA-j48q-4c78-rhf9","summary":"openssl-encrypt: Dynamic .so loading for Whirlpool uses broad glob pattern without integrity verification","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.","aliases":["CVE-2026-74872","PYSEC-2026-3742"],"modified":"2026-09-01T09:25:19.420612443Z","published":"2026-03-31T23:31:29Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2026-03-31T23:31:29Z","nvd_published_at":null,"cwe_ids":["CWE-427"],"severity":"MODERATE"},"references":[{"type":"WEB","url":"https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-j48q-4c78-rhf9"},{"type":"WEB","url":"https://github.com/jahlives/openssl_encrypt/commit/963d0d1278b722ea134272f9df65fddcd3e6ab47"},{"type":"PACKAGE","url":"https://github.com/jahlives/openssl_encrypt"}],"affected":[{"package":{"name":"openssl-encrypt","ecosystem":"PyPI","purl":"pkg:pypi/openssl-encrypt"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.4.0"}]}],"versions":["0.2.2","0.2.3","0.2.4","0.2.5","0.2.6","0.3.0","0.3.1","0.3.2","0.3.3","0.4.0","0.4.1","0.4.2","0.4.3","0.4.4","0.5.0","0.5.1","0.5.3","0.6.0rc1","0.7.0rc2","0.7.1","0.7.2","0.8.0","0.8.1","0.8.2","0.9.2","1.0.0","1.0.1","1.0.2","1.0.3","1.1.0","1.2.0","1.2.1","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.4.0b3","1.4.0b4","1.4.0b5","1.4.0b6","1.4.0b7","1.4.0b8"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-j48q-4c78-rhf9/GHSA-j48q-4c78-rhf9.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}