Description
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.2, FishActivator inherits ViaTemplateActivator.quote(), which uses POSIX shlex.quote() even though fish interprets backslashes and single quotes differently. An attacker-influenced environment path, --prompt, or VIRTUALENV_PROMPT value containing a backslash before a quote can therefore terminate the generated fish literal and execute command substitution when the user sources activate.fish. This issue is fixed in version 21.14.2.
Published: 2026-10-20
Score: 7.8 High
EPSS: < 1% Very Low
KEV: No
Impact: Local Command Injection via Fish Shell
Action: Immediate Patch
AI Analysis

Impact

The vulnerability stems from a mishandling of quotation and escape processing in the FishActivator of virtualenv. Fish’s shell syntax treats backslashes and single quotes differently from POSIX shlex, yet the activator used shlex.quote(). When an attacker-controlled environment path, --prompt argument, or VIRTUALENV_PROMPT contains a backslash preceding a quote, the injected fish literal can terminate prematurely and trigger command substitution, allowing the user who sources activate.fish to execute arbitrary commands within the environment. The affected weakness identifiers include CWE-116 (Improper Encoding), CWE-78 (OS Command Injection), and CWE-94 (Improper Control of Generation of Code). The consequence is that any user who activates the virtual environment can run arbitrary code, potentially compromising the host system or data stored therein. This flaw does not grant network access to an attacker; it is a local privilege escalation that depends on the user’s ability to influence the environment variables or command line arguments used when creating the virtual environment.

Affected Systems

The issue appears in versions of the PyPA virtualenv tool released before 21.14.2. Systems running those earlier releases of virtualenv on any platform that uses the Fish shell for activation are susceptible. The vulnerability is limited to the virtualenv installation, not the underlying Python interpreter or system libraries.

Risk and Exploitability

The CVSS score of 7.8 reflects a high severity for local code execution, though the EPSS score of less than 1% indicates a low likelihood of widespread exploitation at present. The vulnerability is not listed in the CISA KEV catalog, further suggesting limited observed abuse. Attack exploitation requires an attacker to influence the environment path, prompt string, or VIRTUALENV_PROMPT, typically by installing a malicious package or modifying environment settings beforehand. Once activated, the compromised environment allows the execution of arbitrary commands. The primary attack vector is a local user who sources activate.fish, potentially through malicious package installers or shell scripts that set VIRTUALENV_PROMPT. Proper mitigation requires version update before an attacker can exploit the flaw.

Generated by OpenCVE AI on October 21, 2026 at 18:09 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade virtualenv to version 21.14.2 or later.
  • Sanitize any attacker-controlled strings that may be used in the virtual environment path, --prompt option, or VIRTUALENV_PROMPT environment variable, ensuring no backslashes precede quotation marks before the environment is created.
  • If an upgrade is not immediately possible, switch to a shell that does not use FishActivator (e.g., bash) when activating the virtual environment, or configure the environment to avoid sourcing activate.fish.

Generated by OpenCVE AI on October 21, 2026 at 18:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-c947-3pg5-gm8q virtualenv activate.fish runs commands from a path or prompt with a backslash before a quote
History

Tue, 27 Oct 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 21 Oct 2026 20:15:00 +0000

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

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

Type Values Removed Values Added
Weaknesses CWE-94
References
Metrics threat_severity

None

threat_severity

Important


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

Type Values Removed Values Added
Description virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.2, FishActivator inherits ViaTemplateActivator.quote(), which uses POSIX shlex.quote() even though fish interprets backslashes and single quotes differently. An attacker-influenced environment path, --prompt, or VIRTUALENV_PROMPT value containing a backslash before a quote can therefore terminate the generated fish literal and execute command substitution when the user sources activate.fish. This issue is fixed in version 21.14.2.
Title virtualenv activate.fish runs commands from a path or prompt with a backslash before a quote
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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-27T13:26:51.760Z

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

Link: CVE-2026-113732

cve-icon Vulnrichment

Updated: 2026-10-27T13:26:47.089Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-10-20T22:19:30.413

Modified: 2026-10-27T14:16:33.643

Link: CVE-2026-113732

cve-icon Redhat

Severity : Important

Publid Date: 2026-10-20T22:01:23Z

Links: CVE-2026-113732 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-21T20:00:13Z

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output

  • CWE-78

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

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')