GHSA-vfgx-5q85-58q3: Openssl encrypt Openssl-encrypt Has Non-cryptographic PRNG Used Vulnerability

MODERATE
CWE-330
Published
Advisory Summary

GHSA-vfgx-5q85-58q3 is a MODERATE openssl-encrypt has non-cryptographic prng used vulnerability (CWE-330: Use of Insufficiently Random Values) affecting Openssl encrypt libraries in the PyPI ecosystem. The issue involves openssl-encrypt has non-cryptographic prng used for steganography pixel selection. Remediation is available by upgrading affected packages to version 1.4.0.

GHSA-vfgx-5q85-58q3 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-vfgx-5q85-58q3
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-330: Use of Insufficiently Random Values
Affected Product Openssl encrypt
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-vfgx-5q85-58q3

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-vfgx-5q85-58q3, 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-330: Use of Insufficiently Random Values, where the product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers. 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

### Summary The `generate_pseudorandom_sequence()` function in `openssl_encrypt/plugins/steganography/core/utils.py` at **lines 89-91** uses Python's `random` module (Mersenne Twister) for steganographic pixel/sample selection. ### Affected Code ```python random.seed(seed) sequence = random.sample(range(max_value), min(length, max_value)) return sequence ``` Additionally, the steganography password is stored as a plain Python string (not `SecureBytes`) and only 8 bytes (64 bits) of the SHA-256 hash are used for the seed, reducing effective security to 64 bits. ### Impact The Mersenne Twister's state can be recovered from approximately 624 outputs. An attacker who knows or guesses the password can predict the PRNG sequence and determine exactly which pixels contain hidden data, potentially extracting the hidden data without the password. ### Recommended Fix - Use HMAC-DRBG or `secrets` module for cryptographically secure pixel selection - Use full 32-byte SHA-256 output as seed material - Store the password in `SecureBytes` instead of a plain string ### Fix Fixed in commit `09e96e0` on branch `releases/1.4.x` — replaced random.seed(hash(password)) with HMAC-SHA256 based CSPRNG (Fisher-Yates shuffle) and numpy Generator with HMAC-derived seeds across all steganography format modules.

GHSA-vfgx-5q85-58q3 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-vfgx-5q85-58q3?
GHSA-vfgx-5q85-58q3 is a security vulnerability in Openssl encrypt involving openssl-encrypt has non-cryptographic PRNG used for steganography pixel selection under CWE-330: Use of Insufficiently Random Values.
Which Openssl encrypt versions are affected?
Affected versions include releases prior to 1.4.0 across affected packages: openssl-encrypt.
What version fixes GHSA-vfgx-5q85-58q3?
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-vfgx-5q85-58q3?
GHSA-vfgx-5q85-58q3 is classified under CWE-330: Use of Insufficiently Random Values (The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.).
How can I check PyPI dependencies for GHSA-vfgx-5q85-58q3?
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-vfgx-5q85-58q3",
  "modified" : "2026-03-31T23:43:06Z",
  "published" : "2026-03-31T23:43:06Z",
  "aliases" : [ ],
  "summary" : "openssl-encrypt has non-cryptographic PRNG used for steganography pixel selection",
  "details" : "### Summary\n\nThe `generate_pseudorandom_sequence()` function in `openssl_encrypt/plugins/steganography/core/utils.py` at **lines 89-91** uses Python's `random` module (Mersenne Twister) for steganographic pixel/sample selection.\n\n### Affected Code\n\n```python\nrandom.seed(seed)\nsequence = random.sample(range(max_value), min(length, max_value))\nreturn sequence\n```\n\nAdditionally, the steganography password is stored as a plain Python string (not `SecureBytes`) and only 8 bytes (64 bits) of the SHA-256 hash are used for the seed, reducing effective security to 64 bits.\n\n### Impact\n\nThe Mersenne Twister's state can be recovered from approximately 624 outputs. An attacker who knows or guesses the password can predict the PRNG sequence and determine exactly which pixels contain hidden data, potentially extracting the hidden data without the password.\n\n### Recommended Fix\n\n- Use HMAC-DRBG or `secrets` module for cryptographically secure pixel selection\n- Use full 32-byte SHA-256 output as seed material\n- Store the password in `SecureBytes` instead of a plain string\n\n### Fix\n\nFixed in commit `09e96e0` on branch `releases/1.4.x` — replaced random.seed(hash(password)) with HMAC-SHA256 based CSPRNG (Fisher-Yates shuffle) and numpy Generator with HMAC-derived seeds across all steganography format modules.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/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-vfgx-5q85-58q3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jahlives/openssl_encrypt/commit/09e96e090417d34d2f533f6810d3cd4f77810101"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jahlives/openssl_encrypt"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-330" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-31T23:43:06Z",
    "nvd_published_at" : null
  }
}