GHSA-j48q-4c78-rhf9: openssl-encrypt Dynamic .so Loading For Whirlpool Vulnerability

MODERATE
CWE-427
Published
Advisory Summary

GHSA-j48q-4c78-rhf9 is a MODERATE dynamic .so loading for whirlpool vulnerability (CWE-427: Uncontrolled Search Path Element) affecting openssl-encrypt libraries in the PyPI ecosystem. The issue involves dynamic .so loading for whirlpool uses broad glob pattern without integrity verification. Remediation is available by upgrading affected packages to version 1.4.0.

GHSA-j48q-4c78-rhf9 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-j48q-4c78-rhf9
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-427: Uncontrolled Search Path Element
Affected Product openssl-encrypt
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-j48q-4c78-rhf9

To remediate this vulnerability, upgrade all affected openssl-encrypt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

openssl-encrypt fixed: 1.4.0
pip install openssl-encrypt>=1.4.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show openssl-encrypt

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-j48q-4c78-rhf9, inspect your installed packages using pip:

pip show openssl-encrypt

Analyze the terminal output to locate any version of openssl-encrypt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.0), your application is affected.

Note: The pip show openssl-encrypt command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-427: Uncontrolled Search Path Element, where the product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors. In openssl-encrypt, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Severity: HIGH ### Summary The 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. ### Affected Code ```python for site_pkg in site.getsitepackages(): pattern = os.path.join(site_pkg, "whirlpool*py313*.so") py313_modules = glob.glob(pattern) if py313_modules: module_path = py313_modules[0] # Takes first match loader = ExtensionFileLoader("whirlpool", module_path) spec = importlib.util.spec_from_file_location("whirlpool", module_path, loader=loader) whirlpool_module = importlib.util.module_from_spec(spec) spec.loader.exec_module(whirlpool_module) ``` ### Impact The glob pattern `"whirlpool*py313*.so"` is broad and takes the first match without verifying: - File hash/signature - File ownership/permissions - Whether it's a legitimate module If an attacker can place a malicious `.so` file matching this pattern in any site-packages directory, it will be loaded and native code executed. ### Recommended Fix - Verify the module's integrity (hash or signature) before loading - Use a specific filename rather than a glob pattern - Check file permissions and ownership ### Fix Fixed 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.

GHSA-j48q-4c78-rhf9 Affected openssl-encrypt Versions

1 component(s)
Fixed Versions:
1.4.0
Product / Package Ecosystem Affected Versions Fixed Version
openssl-encrypt
PyPI
< 1.4.0
1.4.0

References

Frequently Asked Questions

What is GHSA-j48q-4c78-rhf9?
GHSA-j48q-4c78-rhf9 is a security vulnerability in openssl-encrypt involving Dynamic .so loading for Whirlpool uses broad glob pattern without integrity verification under CWE-427: Uncontrolled Search Path Element.
Which openssl-encrypt versions are affected?
Affected versions include releases prior to 1.4.0 across affected packages: openssl-encrypt.
What version fixes GHSA-j48q-4c78-rhf9?
Upgrading to 1.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is openssl-encrypt affected?
Yes, openssl-encrypt is affected in releases prior to 1.4.0. Upgrade your dependency to 1.4.0 or later.
What CWE is associated with GHSA-j48q-4c78-rhf9?
GHSA-j48q-4c78-rhf9 is classified under CWE-427: Uncontrolled Search Path Element (The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.).
How can I check PyPI dependencies for GHSA-j48q-4c78-rhf9?
Run the dependency tree command: 'pip show openssl-encrypt'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-j48q-4c78-rhf9",
  "modified" : "2026-03-31T23:31:29Z",
  "published" : "2026-03-31T23:31:29Z",
  "aliases" : [ ],
  "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.",
  "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "openssl-encrypt"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.0"
      } ]
    } ]
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-427" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-31T23:31:29Z",
    "nvd_published_at" : null
  }
}