Description
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the builtin creator calls ensure_dir() for executable, library, and package directories, and ensure_dir() accepts an existing symlink to a directory because exists() follows it. Interpreter creation, seed installation, and activation generation then write through the linked parent outside the requested destination when another local account prepared the tree and the invoking user can access the target. The --clear option removes the planted tree first, while ordinary creation reaches it; arbitrary attacker-selected output bytes are not established. This issue is fixed in version 21.14.9.
Published: 2026-10-20
Score: 4.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Local File Write
Action: Patch
AI Analysis

Impact

The vulnerability arises from the virtualenv built‑in creator calling ensure_dir() for the executable, library, and package directories. Since ensure_dir() accepts an existing symlink to a directory because the existence check follows symlinks, the creator can write interpreter executables, seed packages, and activation scripts through the symlink into the parent directory outside the requested virtual environment. The tool does not allow an attacker to control the exact output bytes, but it can overwrite or create files in the parent path, potentially affecting system‑wide or other users’ files and leading to integrity or privilege‑escalation problems.

Affected Systems

The flaw affects any installation of the PyPA virtualenv package older than 21.14.9 on systems where a writable symlink points to a directory owned by another local account. Users invoking virtualenv on such systems are at risk because the built‑in creator may escape the intended environment and write files outside the target directory.

Risk and Exploitability

The CVSS score of 4.5 classifies this as a moderate‑severity vulnerability. No EPSS score is published, and it is not listed in the CISA KEV catalog. The attack is local: it requires the attacker to have write permissions to a symlink that points to another user’s existing directory tree. Because arbitrary output bytes cannot be chosen, the flaw does not provide code execution, but it allows overwriting or deleting files outside the virtual environment, which could lead to unintended system state changes or privilege escalation in shared environments.

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

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade virtualenv to version 21.14.9 or later.
  • If an upgrade is not immediately possible, run virtualenv with the --clear option before creating the environment so that any pre‑existing linked trees are removed.
  • Restrict the current user’s write permissions to directories that could be targets of symlinks, or remove such symlinks before invoking virtualenv.

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-cw65-gx24-rc82 virtualenv: Builtin creation follows linked environment directories
History

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

Type Values Removed Values Added
Metrics ssvc

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


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

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Moderate


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

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

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

Type Values Removed Values Added
Description virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the builtin creator calls ensure_dir() for executable, library, and package directories, and ensure_dir() accepts an existing symlink to a directory because exists() follows it. Interpreter creation, seed installation, and activation generation then write through the linked parent outside the requested destination when another local account prepared the tree and the invoking user can access the target. The --clear option removes the planted tree first, while ordinary creation reaches it; arbitrary attacker-selected output bytes are not established. This issue is fixed in version 21.14.9.
Title virtualenv: Builtin creation follows linked environment directories
Weaknesses CWE-59
References
Metrics cvssV3_1

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


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-21T15:52:40.004Z

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

Link: CVE-2026-113716

cve-icon Vulnrichment

Updated: 2026-10-21T14:24:42.669Z

cve-icon NVD

Status : Awaiting Analysis

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

Modified: 2026-10-22T16:47:38.403

Link: CVE-2026-113716

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-20T19:18:09Z

Links: CVE-2026-113716 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T21:00:18Z

Weaknesses
  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')