CVE-2026-113719 in virtualenvinfo

Summary

by MITRE • 10/20/2026

virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, PipInstall._uninstall_previous_version() accepts existing seed-package metadata and _uninstall_dist() joins entries from top_level.txt and RECORD to site-packages without checking containment. When a reused destination contains distribution metadata influenced by another account, relative traversal, absolute entries, or linked parents can cause app-data reseeding to delete files outside the environment or the environment root with the invoking user's permissions, provided that user has deletion rights over the named paths. The deletion occurs during environment creation before any later use of the environment. Fresh environments without existing package metadata and creation with --clear do not enter this cleanup path. This issue is fixed in version 21.14.9.

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 10/20/2026

The vulnerability identified within virtualenv versions prior to 21.14.9 represents a critical directory traversal and arbitrary file deletion flaw rooted in the improper handling of package metadata during environment initialization. Virtualenv operates by creating isolated Python environments, typically relying on pip for dependency management. The core technical failure occurs specifically within the PipInstall._uninstall_previous_version() method when it interacts with existing seed-package metadata. In this process, the _uninstall_dist function aggregates file paths from two primary sources: top_level.txt and RECORD files contained within a distribution's metadata directory. These files list the locations of installed package components relative to or absolute within the site-packages directory. The critical defect lies in the fact that these path entries are joined directly with the target site-packages directory without any validation to ensure they remain strictly contained within the intended environment root.

This lack of containment checking allows for severe security implications if an attacker can influence the metadata present in a reused destination directory. If a virtualenv is created by reusing an existing directory that contains distribution metadata crafted or influenced by another user account, the tool will process those malicious entries. Specifically, relative traversal sequences such as ../ are not sanitized, and absolute paths embedded within RECORD files are accepted without restriction. Furthermore, linked parents in the file system structure can be exploited to escape the sandboxed environment boundaries. Consequently, when the cleanup phase of environment creation is triggered, it attempts to delete files based on these unvalidated paths. Because this operation executes with the permissions of the invoking user, any path that falls outside the virtualenv root but within the deletion rights of that user will be permanently removed. This constitutes a severe arbitrary file deletion vulnerability, potentially leading to data loss or denial of service for other applications and system components sharing the same user context.

The operational impact is particularly acute during the environment creation phase, which occurs before any actual application code utilizing the virtualenv is executed. An attacker who can control the contents of a directory that will be used as a base for a new virtualenv can trigger this deletion mechanism simply by initiating the creation process. It is important to note that fresh environments created in empty directories or those explicitly initialized with the --clear flag do not enter this vulnerable cleanup path, as they lack the pre-existing metadata required to exploit the flaw. However, scenarios involving cached environments, shared development workspaces, or automated build pipelines where directory reuse is common are at high risk. The vulnerability aligns closely with CWE-22: Improper Limitation of a Pathname to a Restricted Directory and CWE-732: Incorrect Permission Assignment for Critical Resource, as it involves both path traversal and insufficient validation of file system operations against the intended security boundary.

From an offensive security perspective, this flaw can be mapped to MITRE ATT&CK technique T1485: Data Destruction, specifically involving local data destruction via script execution or utility misuse. The attack vector is typically Local, requiring either physical access or remote code execution with user-level privileges on the target system where directory reuse occurs. Mitigation strategies are primarily focused on upgrading the virtualenv package to version 21.14.9 or later, which implements strict path validation and containment checks before performing any deletion operations. For environments that cannot be immediately upgraded, administrators should avoid reusing directories for new virtualenvs unless they can guarantee the integrity of existing metadata. Additionally, enforcing stricter file system permissions on shared development directories can limit an attacker's ability to inject malicious RECORD or top_level.txt files into a target directory. Security teams should also audit CI/CD pipelines and automated testing frameworks that provision Python environments to ensure they do not inadvertently rely on reused stateful directories without proper sanitization of prior package metadata.

Responsible

GitHub M

Reservation

10/20/2026

Disclosure

10/20/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!