Description
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.7.11, PyEnvCfg.write() writes prompt values verbatim to the line-oriented pyvenv.cfg format while PyEnvCfg._read_values() parses the file with str.splitlines() and accepts the last value for duplicate keys. An attacker who influences --prompt, VIRTUALENV_PROMPT, or configuration input can insert a recognized line boundary and additional keys, including home, causing consumers to use an attacker-selected base interpreter or corrupted environment metadata. The security impact requires prompt input from outside the operator's trust boundary; directly supplied prompt content primarily corrupts the operator's own environment. This issue is fixed in version 21.7.11.
Published: 2026-09-29
Score: 5.8 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Configuration Injection
Action: Immediate Patch
AI Analysis

Impact

virtualenv writes prompt values directly into the pyvenv.cfg file without sanitizing line boundaries, allowing an attacker who controls the --prompt option, the VIRTUALENV_PROMPT environment variable, or configuration input to inject arbitrary key/value pairs such as home. The injection corrupts the metadata used by consumers of the virtual environment, potentially causing them to use an attacker‑selected base interpreter or otherwise misconfigure the environment. The vulnerability primarily affects the creator’s own environment and requires input that originates outside the operator’s trust boundary.

Affected Systems

The vulnerability impacts all installations of the PyPA virtualenv tool that run a version earlier than 21.7.11. Any virtualenv created or managed by a user with the ability to supply a prompt value, environment variable, or configuration file is affected.

Risk and Exploitability

The CVSS score of 5.8 indicates a moderate severity. Exploitation requires local access to influence the prompt value or environment variable, and no remote code execution is possible. EPSS information is not available and the issue is not listed in CISA KEV. As a result, the risk is moderate, limited to users who can supply untrusted prompt input to virtualenv. The issue is addressed in virtualenv 21.7.11.

Generated by OpenCVE AI on September 30, 2026 at 10:50 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update virtualenv to version 21.7.11 or later, which sanitizes prompt values and removes the injection flaw.
  • Avoid using untrusted input sources for --prompt, VIRTUALENV_PROMPT, or configuration files when creating virtual environments; sanitize or strip line breaks from prompt values.
  • Regenerate any virtual environments that were created with earlier virtualenv versions to ensure the environment metadata is correct and not corrupted by injected values.

Generated by OpenCVE AI on September 30, 2026 at 10:50 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-9h9j-4vrj-gf7g virtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration injection
History

Thu, 01 Oct 2026 00:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.0, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H'}

threat_severity

Moderate


Wed, 30 Sep 2026 21:00:00 +0000

Type Values Removed Values Added
First Time appeared Pypa
Pypa virtualenv
Python
Python virtualenv
Vendors & Products Pypa
Pypa virtualenv
Python
Python virtualenv

Wed, 30 Sep 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 29 Sep 2026 21:00:00 +0000

Type Values Removed Values Added
Description virtualenv is a tool for creating isolated virtual python environments. Prior to 21.7.11, PyEnvCfg.write() writes prompt values verbatim to the line-oriented pyvenv.cfg format while PyEnvCfg._read_values() parses the file with str.splitlines() and accepts the last value for duplicate keys. An attacker who influences --prompt, VIRTUALENV_PROMPT, or configuration input can insert a recognized line boundary and additional keys, including home, causing consumers to use an attacker-selected base interpreter or corrupted environment metadata. The security impact requires prompt input from outside the operator's trust boundary; directly supplied prompt content primarily corrupts the operator's own environment. This issue is fixed in version 21.7.11.
Title virtualenv writes prompt values into pyvenv.cfg without sanitizing line boundaries, allowing configuration injection
Weaknesses CWE-93
References
Metrics cvssV4_0

{'score': 5.8, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N'}


Subscriptions

Pypa Virtualenv
Python Virtualenv
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-09-30T19:53:20.817Z

Reserved: 2026-09-29T20:24:43.340Z

Link: CVE-2026-102938

cve-icon Vulnrichment

Updated: 2026-09-30T19:53:14.111Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-09-29T21:17:19.047

Modified: 2026-09-30T20:17:25.517

Link: CVE-2026-102938

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-09-29T20:58:20Z

Links: CVE-2026-102938 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-09-30T20:35:29Z

Weaknesses
  • CWE-93

    Improper Neutralization of CRLF Sequences ('CRLF Injection')