Summary
openssl-encrypt's unverified key bundle fromdict() + toidentity() path allows encryption to attacker keys
The PublicKeyBundle.from_dict() method in openssl_encrypt/modules/key_bundle.py at lines 329-361 creates bundles from untrusted data without verifying the signature. The docstring warns to call verify_signature() after creation, but the to_identity() method (line 363-391) can convert an unverified bundle directly to an Identity object.
Affected Code
@classmethod
def from_dict(cls, data: Dict) -> "PublicKeyBundle":
"""
SECURITY: Does NOT verify signature. Call verify_signature() after creation.
"""
# Creates bundle without verification
Fix
Fixed in commit f4a1ba6 on branch releases/1.4.x, from_dict() now verifies self_signature by default (verify=True parameter); raises ValueError on verification failure.
Impact
If from_dict() followed by to_identity() is called without an intervening verify_signature() call, encryption could be performed against an attacker's public key, leaking secrets. While key_resolver.py (lines 146-147) does verify before use, the unguarded API path remains directly callable.
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
- Add a
verifiedflag toPublicKeyBundlethat must be set beforeto_identity()can be called - Or have
to_identity()automatically callverify_signature()and raise on failure - Or make
from_dict()require verification as part of construction
Frequently Asked Questions
- What is GHSA-8H88-GXP3-J7PG? GHSA-8H88-GXP3-J7PG 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-8H88-GXP3-J7PG? openssl-encrypt (pip) versions < 1.4.0 is affected.
- Is there a fix for GHSA-8H88-GXP3-J7PG? Yes. GHSA-8H88-GXP3-J7PG is fixed in 1.4.0. Upgrade to this version or later.
- Is GHSA-8H88-GXP3-J7PG exploitable, and should I be worried? Whether GHSA-8H88-GXP3-J7PG 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-8H88-GXP3-J7PG 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-8H88-GXP3-J7PG? Upgrade
openssl-encryptto 1.4.0 or later.