---
id: CVE-2026-113721
title: 'virtualenv: Generated files can follow existing destination links'
summary: >-
  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 ge…
severity: medium
cvss: 4.5
cvssVector: 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L'
cvssSource: cna
cwe:
  - CWE-59
vendor: pypa
product: virtualenv
affected:
  - virtualenv < 21.14.9
published: '2026-10-20'
updated: '2026-10-20'
sourceUpdated: '2026-10-20T19:46:28.770Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-113721'
references:
  - url: 'https://github.com/pypa/virtualenv/security/advisories/GHSA-558c-9hv2-4prj'
    label: 'https://github.com/pypa/virtualenv/security/advisories/GHSA-558c-9hv2-4prj'
  - url: 'https://github.com/pypa/virtualenv/pull/3431'
    label: 'https://github.com/pypa/virtualenv/pull/3431'
  - url: >-
      https://github.com/pypa/virtualenv/commit/d25f28699eefb1fc34a251e5adf2b5de844c36cd
    label: >-
      https://github.com/pypa/virtualenv/commit/d25f28699eefb1fc34a251e5adf2b5de844c36cd
  - url: 'https://github.com/pypa/virtualenv/releases/tag/21.14.9'
    label: 'https://github.com/pypa/virtualenv/releases/tag/21.14.9'
tags:
  - cve.org
ingestedAt: '2026-10-20T20:18:14.531Z'
---

## Overview

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

- `virtualenv < 21.14.9`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
