Description
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the safe_delete() deletion error handler responds to a failed removal by reading mode bits with os.lstat(path) and applying owner-write permission with os.chmod(path, ...), which follows a symlink. A planted link inside a read-only directory can therefore cause a victim-owned target outside the destination that is initially not writable by the invoking user to become broadly writable before the retry fails, provided that user owns the target and can change its mode. Another account can use the widened mode only if it can traverse the target's parent directories; root does not reach the demonstrated failure path, and the operation does not itself read the target. This issue is fixed in version 21.14.9.
Published: 2026-10-20
Score: 4.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Privilege Escalation
Action: Apply patch
AI Analysis

Impact

The safe_delete handler attempts to recover from a deletion error by inspecting and restoring permission bits on the file it failed to remove. Because it follows symlinks when fetching the mode, a symlink pointing to a target outside the intended directory can be used to set that target’s permissions, turning an otherwise non‑writable file into a writable one. This permission escalation can allow a local user to overwrite or tamper with artifacts that should be protected, potentially compromising the isolation of the virtual environment.

Affected Systems

Vulnerable versions of the PyPA virtualenv tool up to and including 21.14.8, and any earlier releases, are affected. The issue does not apply to version 21.14.9 and newer, which contain a fix that prevents the symlink resolution during mode restoration.

Risk and Exploitability

The CVSS score of 4.5 classifies this as a moderate risk. No EPSS data is available, and the vulnerability is not listed in CISA's KEV catalog. The bug is exploitable in a local context, requiring that the attacker create a symlink inside a directory that virtualenv will delete. The attacker must own the target file to be able to change its mode; traversal of the target’s parent directories is necessary for another account to benefit from the widened permissions. Root cannot reach the failure path, reducing the danger of a system-wide compromise. Nonetheless, an unprivileged user could subvert the isolation guarantees of virtualenv.

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

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to virtualenv 21.14.9 or newer
  • Ensure that no symlinks can be created in directories used for virtualenv deletion
  • If an immediate upgrade is not possible, run virtualenv in a chroot or container that isolates the filesystem and restricts traversal of the target directories

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

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-43mp-35q3-x3fq virtualenv: Deletion recovery can change a symlink target's mode
History

Tue, 10 Nov 2026 21:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Thu, 22 Oct 2026 13:45:00 +0000

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

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 20:00:00 +0000

Type Values Removed Values Added
Description virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the safe_delete() deletion error handler responds to a failed removal by reading mode bits with os.lstat(path) and applying owner-write permission with os.chmod(path, ...), which follows a symlink. A planted link inside a read-only directory can therefore cause a victim-owned target outside the destination that is initially not writable by the invoking user to become broadly writable before the retry fails, provided that user owns the target and can change its mode. Another account can use the widened mode only if it can traverse the target's parent directories; root does not reach the demonstrated failure path, and the operation does not itself read the target. This issue is fixed in version 21.14.9.
Title virtualenv: Deletion recovery can change a symlink target's mode
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-27T11:02:51.974Z

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

Link: CVE-2026-113724

cve-icon Vulnrichment

Updated: 2026-10-27T11:02:42.502Z

cve-icon NVD

Status : Awaiting Analysis

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

Modified: 2026-10-27T12:17:05.240

Link: CVE-2026-113724

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-20T19:53:29Z

Links: CVE-2026-113724 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-22T13:30:05Z

Weaknesses
  • CWE-59

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