GHSA-vfgx-5q85-58q3

Suggest an improvement
Source
https://github.com/advisories/GHSA-vfgx-5q85-58q3
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-vfgx-5q85-58q3/GHSA-vfgx-5q85-58q3.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-vfgx-5q85-58q3
Aliases
Published
2026-03-31T23:43:06Z
Modified
2026-09-02T09:10:33Z
Severity
  • 6.6 (Medium) CVSS_V4 - 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 CVSS Calculator
Summary
openssl-encrypt has non-cryptographic PRNG used for steganography pixel selection
Details

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

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.

Database specific
{
    "cwe_ids":  [
        "CWE-330"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-03-31T23:43:06Z",
    "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/03/GHSA-vfgx-5q85-58q3/GHSA-vfgx-5q85-58q3.json"