Cloudanix VulnDB

CVE-2026-113721

Medium · 4.5

CVSS

4.5

EPSS

0.1%

Published

Oct 20, 2026

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A bug in a popular Python tool for making isolated coding environments could let another person on the same computer secretly change or create files you own when you set up a new environment.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
High
Impact
Data Tampering
Component
Library
Class
Path Traversal
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

ViaTemplateActivator._generate() skips removal of existing output when Path.exists() is false on a dangling symlink, and PyEnvCfg.write() opens pyvenv.cfg without replacing existing symbolic or hard links, allowing a local attacker to redirect writes of virtualenv-generated activation scripts and configuration outside the target tree using the caller's permissions and limited attacker-controlled content.

Why it matters to the business

On multi-user systems, older virtualenv versions can let another local account cause file creation or overwrites in locations the environment owner controls, increasing risk of tampering or limited privilege abuse during environment setup; low urgency given no known exploitation or ransomware use six days after disclosure.

How an attack unfolds

A local attacker prepares a dangling symlink or link pointing outside the intended destination. When the victim invokes virtualenv to create an environment at that path, the tool follows the link without replacement and writes constrained activation content and pyvenv.cfg entries using the victim's permissions, achieving writes outside the requested tree.

How to fix it

Upgrade virtualenv to version 21.14.9 or newer on all systems; replace any existing virtual environments created with vulnerable versions after the upgrade.

How to confirm the fix worked

Run 'python -m pip show virtualenv' and confirm version 21.14.9 or later; test environment creation in a directory containing a prepared symlink and verify no external files are written.

Typical attack path

  1. Create a dangling symlink or hard link in the target parent directory pointing to a desired external location
  2. Ensure the destination parent remains writable by the attacker during the window of creation
  3. Induce or wait for the victim user to run virtualenv targeting that path
  4. Observe or leverage the resulting files written outside the environment with the victim's permissions and virtualenv-generated content

How to detect it

Review process creation logs and file system audit trails for virtualenv invocations that coincide with unexpected file writes outside known environment directories; inspect pyvenv.cfg and activation scripts for paths that resolve outside the requested tree.

What your security team should do

  • Upgrade all virtualenv installations to 21.14.9 or later within the next patch cycle
  • Scan for and recreate any virtual environments built with versions prior to 21.14.9
  • Restrict local account access on shared development or build hosts where virtualenv is used
  • Add virtualenv version checks to CI and developer onboarding scripts

The record

virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, ViaTemplateActivator._generate() removes an existing output only when Path.exists() is true, allowing a dangling symlink to survive and redirect generated activation content, while PyEnvCfg.write() opens pyvenv.cfg without first replacing an existing symbolic or hard link. Another local account that prepares final entries inside the destination can therefore cause environment creation to create or overwrite files outside the requested tree with constrained virtualenv-generated content and the invoking user's permissions. The destination parent must remain controlled by the environment owner during creation; concurrent parent-directory replacement is a separate concern. This issue is fixed in version 21.14.9.

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities