CVE-2026-113721: CWE-59: Improper Link Resolution Before File Access ('Link Following') in pypa virtualenv
Description
CVE-2026-113721 is a vulnerability in pypa virtualenv prior to version 21.14.9 involving improper link resolution before file access. It allows a local attacker with limited privileges to cause environment creation to overwrite or create files outside the intended directory by exploiting dangling symbolic or hard links during activation content generation and configuration file writing.
CVSS v3.1
Score 4.5medium
Affected software
pypa
virtualenv
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in virtualenv versions before 21.14.9 arises because ViaTemplateActivator._generate() only removes existing output if Path.exists() returns true, allowing dangling symlinks to persist and redirect activation content generation. Additionally, PyEnvCfg.write() opens pyvenv.cfg without replacing existing symbolic or hard links first. This improper handling of symbolic and hard links (CWE-59) enables a local user who can prepare entries inside the destination directory to cause files outside the requested environment tree to be created or overwritten with virtualenv-generated content, using the invoking user's permissions. The issue requires that the destination parent directory remains controlled by the environment owner during creation. The vulnerability is fixed in version 21.14.9.
Potential Impact
A local attacker with limited privileges can exploit this vulnerability to create or overwrite files outside the intended virtual environment directory, potentially leading to unauthorized file modification or privilege escalation within the scope of the invoking user's permissions. The impact includes limited confidentiality, integrity, and availability loss as indicated by the CVSS score of 4.5.
Mitigation Recommendations
This vulnerability is fixed in virtualenv version 21.14.9. Users should upgrade to version 21.14.9 or later to remediate the issue. No additional mitigation is required if the environment owner controls the destination parent directory during environment creation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-10-20T16:03:14.863Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6ad7c9302cdf04f656591b14
Added to database: 10/20/2026, 20:04:00 UTC
Last enriched: 10/20/2026, 20:18:26 UTC
Last updated: 10/20/2026, 20:19:54 UTC
Views: 7
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.