Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-22702: CWE-59: Improper Link Resolution Before File Access ('Link Following') in pypa virtualenv

0
Medium
VulnerabilityCVE-2026-22702cvecve-2026-22702cwe-59cwe-362
Published: Sat Jan 10 2026 (01/10/2026, 06:05:53 UTC)
Source: CVE Database V5
Vendor/Project: pypa
Product: virtualenv

Description

virtualenv is a tool for creating isolated virtual python environments. Prior to version 20.36.1, TOCTOU (Time-of-Check-Time-of-Use) vulnerabilities in virtualenv allow local attackers to perform symlink-based attacks on directory creation operations. An attacker with local access can exploit a race condition between directory existence checks and creation to redirect virtualenv's app_data and lock file operations to attacker-controlled locations. This issue has been patched in version 20.36.1.

AI-Powered Analysis

AILast updated: 01/17/2026, 07:55:38 UTC

Technical Analysis

CVE-2026-22702 is a Time-of-Check-Time-of-Use (TOCTOU) race condition vulnerability in the virtualenv tool, versions prior to 20.36.1. Virtualenv is widely used to create isolated Python environments, commonly employed in development and deployment pipelines. The vulnerability arises due to improper link resolution before file access (CWE-59) and a race condition (CWE-362) during directory creation operations. Specifically, virtualenv performs a check to see if a directory exists and then attempts to create it if absent. An attacker with local access can exploit the time gap between these operations by replacing the directory path with a symbolic link pointing to an attacker-controlled location. This redirection affects virtualenv's app_data and lock file operations, potentially allowing the attacker to manipulate or corrupt files that virtualenv relies on. Although exploitation requires local access and elevated privileges, the impact includes limited confidentiality, integrity, and availability degradation, such as unauthorized file modification or denial of service in the virtual environment setup. The vulnerability has been addressed in virtualenv version 20.36.1 by fixing the TOCTOU race condition and ensuring proper link resolution before file operations. No known exploits are currently reported in the wild.

Potential Impact

For European organizations, the primary impact is on development, testing, and continuous integration environments where virtualenv is used extensively. Successful exploitation could allow an attacker with local access to interfere with Python environment setups, potentially leading to corrupted environments, unauthorized code execution in some scenarios, or denial of service in automated pipelines. This could disrupt software development lifecycles, delay deployments, and introduce risks of further compromise if attackers manipulate environment files. Confidentiality impact is limited since the attacker must already have local access, but integrity and availability impacts are more significant. Organizations relying heavily on Python for critical applications or infrastructure automation may face operational disruptions. The risk is heightened in shared or multi-user systems where local privilege boundaries are less strictly enforced.

Mitigation Recommendations

The most effective mitigation is to upgrade all virtualenv installations to version 20.36.1 or later, where the vulnerability is patched. Organizations should audit their environments to identify and remediate outdated virtualenv versions, especially on developer workstations, build servers, and CI/CD infrastructure. Restrict local access to trusted users only, enforcing strict access controls and user privilege separation to reduce the likelihood of local attackers exploiting the race condition. Employ filesystem monitoring to detect suspicious symbolic link creations or modifications in directories used by virtualenv. Additionally, consider running virtual environment creation processes with minimal privileges and within isolated containers or sandboxes to limit the impact of potential exploitation. Regularly review and update development tools and dependencies to incorporate security patches promptly.

Need more detailed analysis?Upgrade to Pro Console

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-01-08T19:23:09.857Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6961f0b8c540fa4b5432b9f7

Added to database: 1/10/2026, 6:24:56 AM

Last enriched: 1/17/2026, 7:55:38 AM

Last updated: 2/7/2026, 5:12:55 AM

Views: 119

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats