Skip to content

Commit 913ea61

Browse files
1 parent 4b6f449 commit 913ea61

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-j48q-4c78-rhf9",
4+
"modified": "2026-03-31T23:31:29Z",
5+
"published": "2026-03-31T23:31:29Z",
6+
"aliases": [],
7+
"summary": "openssl-encrypt: Dynamic .so loading for Whirlpool uses broad glob pattern without integrity verification",
8+
"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.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"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"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "PyPI",
19+
"name": "openssl-encrypt"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"fixed": "1.4.0"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-j48q-4c78-rhf9"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/jahlives/openssl_encrypt/commit/963d0d1278b722ea134272f9df65fddcd3e6ab47"
44+
},
45+
{
46+
"type": "PACKAGE",
47+
"url": "https://github.com/jahlives/openssl_encrypt"
48+
}
49+
],
50+
"database_specific": {
51+
"cwe_ids": [
52+
"CWE-427"
53+
],
54+
"severity": "MODERATE",
55+
"github_reviewed": true,
56+
"github_reviewed_at": "2026-03-31T23:31:29Z",
57+
"nvd_published_at": null
58+
}
59+
}

0 commit comments

Comments
 (0)