Summary
openssl-encrypt: Dynamic .so loading for Whirlpool uses broad glob pattern without integrity verification
Severity: HIGH
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
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)
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.
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.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
- Verify the module's integrity (hash or signature) before loading
- Use a specific filename rather than a glob pattern
- Check file permissions and ownership
Frequently Asked Questions
- What is GHSA-J48Q-4C78-RHF9? GHSA-J48Q-4C78-RHF9 is a medium-severity security vulnerability in openssl-encrypt (pip), affecting versions < 1.4.0. It is fixed in 1.4.0.
- Which versions of openssl-encrypt are affected by GHSA-J48Q-4C78-RHF9? openssl-encrypt (pip) versions < 1.4.0 is affected.
- Is there a fix for GHSA-J48Q-4C78-RHF9? Yes. GHSA-J48Q-4C78-RHF9 is fixed in 1.4.0. Upgrade to this version or later.
- Is GHSA-J48Q-4C78-RHF9 exploitable, and should I be worried? Whether GHSA-J48Q-4C78-RHF9 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-J48Q-4C78-RHF9 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-J48Q-4C78-RHF9? Upgrade
openssl-encryptto 1.4.0 or later.