CVE-2026-113721
Medium · 4.5CVSS
4.5
EPSS
0.1%
Published
Oct 20, 2026
CISA due date
—
Cloudanix analysis
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
- Create a dangling symlink or hard link in the target parent directory pointing to a desired external location
- Ensure the destination parent remains writable by the attacker during the window of creation
- Induce or wait for the victim user to run virtualenv targeting that path
- 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
- CVE-2026-119336 Pi-hole is a DNS sinkhole that protects devices from unwanted content without installing… CWE-59
- CVE-2026-119334 Pi-hole is a DNS sinkhole that protects devices from unwanted content without installing… CWE-59
- CVE-2026-116250 In server mode pgAdmin 4 validates a path a user gives for a file in their storage… CWE-59
- CVE-2026-119704 Bastille through 1.4.4 contains a symlink following vulnerability in the cp.sh, rcp.sh… CWE-59
- CVE-2026-119291 Zuke is a code-first, strongly typed build automation system for Deno. CWE-59
- CVE-2026-118990 CallBackery versions before 0.62.0 for Perl leave a world-readable dump of the… CWE-59
- CVE-2026-119364 ProFTPD through 1.3.9e and 1.3.10rc1 through 1.3.10rc4 contains a link-following… CWE-59
- CVE-2026-119168 HashiCorp Nomad and Nomad Enterprise are vulnerable to symlink following during… CWE-59