Dev.to Security 🔐 Cybersecurity 👁 0 📖 1 min read

CVE-2026-113721: CVE-2026-113721: Unsafe Link Resolution in virtualenv File Generation

CVE-2026-113721: Unsafe Link Resolution in virtualenv File Generation Vulnerability ID: CVE-2026-113721 CVSS Score: 4.5 Published: 2026-10-22 In Python virtualenv prior to version 21.14.9, activation script generato

CVE-2026-113721: Unsafe Link Resolution in virtualenv File Generation

Vulnerability ID: CVE-2026-113721
CVSS Score: 4.5
Published: 2026-10-22

In Python virtualenv prior to version 21.14.9, activation script generators and configuration writers use Path.exists() before writing files. Because Path.exists() resolves symbolic links, it returns False for dangling symlinks. Consequently, virtualenv skips unlinking pre-planted symbolic links or hard links, writing data directly to target locations outside the intended virtual environment directory.

TL;DR

virtualenv prior to 21.14.9 follows dangling symlinks during environment setup, allowing local attackers to write files outside the target directory.

Technical Details

  • CWE ID: CWE-59
  • Attack Vector: Local
  • CVSS Score: 4.5 (Medium)
  • EPSS Score: 0.00117 (1.57th percentile)
  • Impact: Arbitrary File Creation / Overwrite
  • Exploit Status: No Active Exploitation
  • CISA KEV Status: Not Listed

Affected Systems

  • virtualenv Python package (< 21.14.9)
  • virtualenv: < 21.14.9 (Fixed in: 21.14.9)

Code Analysis

Commit: d25f286

Fix unsafe link resolution in virtualenv template and configuration writers

Mitigation Strategies

  • Upgrade virtualenv package to version 21.14.9 or later.
  • Enforce strict directory permissions (chmod 700) on temporary build folders.
  • Avoid creating virtual environments in shared or world-writable directories.

Remediation Steps:

  1. Upgrade virtualenv across all build environments using pip install --upgrade virtualenv>=21.14.9.
  2. Audit automated scripts and CI/CD pipelines to ensure target directory isolation.
  3. Verify that non-privileged users cannot modify destination environment paths before execution.

References

Read the full report for CVE-2026-113721 on our website for more details including interactive diagrams and full exploit analysis.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.