Medium

openssl-encrypt: Dynamic .so loading for Whirlpool uses broad glob pattern without integrity verification

  • Disclosed: 31.03.2026
  • Updated: 11.10.2026 15:17

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.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) openssl-encrypt < 1.4.0 1.4.0

References

CVSS score -
CVSS 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
Weakness (CWE)
CWE-427
Platform
Python (PyPI)
Package
openssl-encrypt
Disclosed
31.03.2026
Updated
11.10.2026 15:17

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2026-3742 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-j48q-4c78-rhf9 - CC BY 4.0

Vulnerability history: openssl-encrypt

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (60) in the archive
Total entries
60
First → latest
03.2026 08.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • High 1
  • Medium 15
  • Unrated 42

Disclosures per year

  1. 2026: 60
Severity:
  1. openssl-encrypt: Dynamic .so loading for Whirlpool uses broad glob pattern without integrity verification this entry
    Medium CVE-2026-74872 < 1.4.0 1.4.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.