Description
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.7, the bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt. This issue is fixed in version 21.14.7.
Published: 2026-10-20
Score: 7.8 High
EPSS: n/a
KEV: No
Impact: Command Execution via Prompt
Action: Patch Now
AI Analysis

Impact

The vulnerability arises in the bash activate script used by virtualenv before version 21.14.7. The script incorrectly escapes the environment name during the second pass of the PS1 prompt rendering, so that a backslash followed by a dollar sign caused shell expansion to occur. As a result, any command placed in the environment name such as $(…​) is executed each time Bash draws the prompt, giving the user local command execution capability within the shell. This flaw maps to CWE‑116 (Improper Encoding or Escaping) and CWE‑78 (OS Command Injection).

Affected Systems

Any installation of Python’s virtualenv that is older than 21.14.7 is affected—versions such as 21.14.6 and earlier. The issue is tied to the pypa:virtualenv product and applies to all environments where Bash is used to activate the virtual environment.

Risk and Exploitability

The CVSS score of 7.8 indicates high severity, and the EPSS score is currently unavailable. The vulnerability is not listed in the CISA KEV catalog. Exploitation requires a local attacker who can create or activate an environment with a malicious name; each time the Bash prompt is refreshed, the injected commands run. This local command execution could be leveraged for further privilege escalation or persistence on the affected system.

Generated by OpenCVE AI on October 20, 2026 at 22:22 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade virtualenv to version 21.14.7 or later to apply the fixed activation script.
  • If an immediate upgrade is not possible, rename existing virtual environments to eliminate backslashes or shell expansion characters, or avoid creating environments with such names.
  • As a temporary protective measure, avoid activating possibly compromised environments and consider using a non-interactive shell to limit prompt rendering until a patch is available.

Generated by OpenCVE AI on October 20, 2026 at 22:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Important


Tue, 20 Oct 2026 20:00:00 +0000

Type Values Removed Values Added
Description virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.7, the bash activate script escapes the environment name for only one of the two passes bash makes over PS1, so a backslash in the name undoes the escaping and a name containing \$(...) runs as commands in the user's shell each time bash draws the prompt. This issue is fixed in version 21.14.7.
Title virtualenv bash activate runs commands from an environment name with a backslash before $
Weaknesses CWE-116
CWE-78
References
Metrics cvssV3_1

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


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-20T19:56:52.195Z

Reserved: 2026-10-20T16:03:14.863Z

Link: CVE-2026-113725

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-20T20:17:19.257

Modified: 2026-10-20T20:17:19.257

Link: CVE-2026-113725

cve-icon Redhat

Severity : Important

Publid Date: 2026-10-20T19:56:52Z

Links: CVE-2026-113725 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T22:30:18Z

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')