GHSA-8h88-gxp3-j7pg

Suggest an improvement
Source
https://github.com/advisories/GHSA-8h88-gxp3-j7pg
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-8h88-gxp3-j7pg/GHSA-8h88-gxp3-j7pg.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-8h88-gxp3-j7pg
Aliases
Published
2026-04-01T21:11:14Z
Modified
2026-09-02T09:10:23Z
Severity
  • 6.6 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
openssl-encrypt's unverified key bundle from_dict() + to_identity() path allows encryption to attacker keys
Details

Summary

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

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.

Recommended Fix

  • Add a verified flag to PublicKeyBundle that must be set before to_identity() can be called
  • Or have to_identity() automatically call verify_signature() and raise on failure
  • Or make from_dict() require verification as part of construction

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.

Database specific
{
    "cwe_ids": [
        "CWE-347"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-04-01T21:11:14Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
}
References

Affected packages

PyPI / openssl-encrypt

Package

Name
openssl-encrypt
View open source insights on deps.dev
Purl
pkg:pypi/openssl-encrypt

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.4.0

Affected versions

0.*
0.2.2
0.2.3
0.2.4
0.2.5
0.2.6
0.3.0
0.3.1
0.3.2
0.3.3
0.4.0
0.4.1
0.4.2
0.4.3
0.4.4
0.5.0
0.5.1
0.5.3
0.6.0rc1
0.7.0rc2
0.7.1
0.7.2
0.8.0
0.8.1
0.8.2
0.9.2
1.*
1.0.0
1.0.1
1.0.2
1.0.3
1.1.0
1.2.0
1.2.1
1.3.0
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
1.4.0b3
1.4.0b4
1.4.0b5
1.4.0b6
1.4.0b7
1.4.0b8

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-8h88-gxp3-j7pg/GHSA-8h88-gxp3-j7pg.json"