Skip to main content
Vulnerability Database/CVE-2026-113713

CVE-2026-113713: virtualenv Information Disclosure Vulnerability

CVE-2026-113713 is an information disclosure vulnerability in virtualenv that causes environments to link to temporary package files deleted after creation. This post covers technical details, affected versions, impact, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-113713 Overview

CVE-2026-113713 affects virtualenv, the widely used tool for creating isolated Python environments. Versions 21.14.8 through 21.14.9 contain a flaw in the app-data seeder that can link a newly created environment to temporary package files. The virtualenv tool deletes those files when creation finishes, leaving the environment pointing at cache paths its owner no longer controls. The issue is tracked under CWE-377 (Insecure Temporary File) and resolved in version 21.14.10.

Critical Impact

Virtual environments can be linked to deleted temporary cache paths, allowing another local user to populate those paths and influence package contents loaded by the environment.

Affected Products

  • virtualenv version 21.14.8
  • virtualenv version 21.14.9
  • Python projects relying on symlink_app_data via environment variable or configuration file with transient app-data

Discovery Timeline

  • 2026-10-20 - CVE CVE-2026-113713 published to NVD
  • 2026-10-20 - Last updated in NVD database

Technical Details for CVE-2026-113713

Vulnerability Analysis

The flaw lives in the FromAppData seeder in src/virtualenv/seed/embed/via_app_data/via_app_data.py. When virtualenv runs with transient (temporary) app-data, the command-line flag for --symlink-app-data is intentionally disabled. However, the equivalent setting supplied through the VIRTUALENV_SYMLINK_APP_DATA environment variable or a configuration file was not similarly suppressed. As a result, the seeder created symbolic links from the new environment into app-data paths that virtualenv deletes once creation completes.

The environment keeps references to cache locations whose ownership is no longer guaranteed. A local attacker who can predict or race the cache pathname may recreate those files and influence what Python loads from the virtual environment.

Root Cause

The seeder set self.symlinks = options.symlink_app_data without checking whether the backing app-data store was transient. The upstream fix adds that check and logs when symlinking is downgraded to copying.

Attack Vector

Exploitation is local and requires specific conditions: a transient app-data configuration combined with symlink_app_data enabled through environment or config, plus a local user able to write to the predictable cache path after cleanup. The resulting primacy of attacker-controlled files inside the virtual environment can lead to code execution the next time the environment is used.

python
 class FromAppData(BaseEmbed):
     def __init__(self, options: VirtualEnvOptions) -> None:
         super().__init__(options)
-        self.symlinks = options.symlink_app_data
+        self.symlinks = options.symlink_app_data and not self.app_data.transient
+        if options.symlink_app_data and self.app_data.transient:
+            LOGGER.debug("copy seed packages because temporary app-data is removed after creation")
 
     @classmethod
     def add_parser_arguments(cls, parser: ArgumentParser, interpreter: PythonInfo, app_data: AppData) -> None:

Source: GitHub Commit b81995c. The patch forces copying of seed packages whenever app-data is transient, even if symlinking was requested through alternate configuration sources.

Detection Methods for CVE-2026-113713

Indicators of Compromise

  • Symbolic links inside virtual environments pointing to deleted or world-writable paths under the user or system temp directory.
  • Presence of VIRTUALENV_SYMLINK_APP_DATA=1 in shell profiles, CI pipelines, or virtualenv.ini combined with transient app-data usage.
  • Unexpected modification of files under the virtualenv app-data cache path by processes other than virtualenv itself.

Detection Strategies

  • Audit installed virtualenv versions across build hosts and developer workstations; flag any instance between 21.14.8 and 21.14.9.
  • Scan virtual environments for dangling symlinks using find <venv> -xtype l and alert on matches.
  • Review CI/CD runner configurations and container images for environment variables or config files that enable symlink_app_data.

Monitoring Recommendations

  • Monitor file creation events in temporary directories where virtualenv stores app-data, correlating writes with the invoking user.
  • Track package installation and import telemetry from virtual environments created on multi-tenant hosts for unexpected modules.
  • Record command-line arguments for virtualenv and python -m venv invocations to retain forensic context.

How to Mitigate CVE-2026-113713

Immediate Actions Required

  • Upgrade virtualenv to version 21.14.10 or later on all developer, CI, and production systems.
  • Recreate any virtual environments that were built with the affected versions using the patched release.
  • Remove or unset VIRTUALENV_SYMLINK_APP_DATA where transient app-data is in use.

Patch Information

The fix is included in virtualenv 21.14.10, released by the PyPA maintainers. See the GitHub Security Advisory GHSA-4f8h-vr72-p32c, Pull Request #3437, and the 21.14.10 Release Notes for full details.

Workarounds

  • Avoid combining transient app-data with symlink_app_data by removing the setting from environment variables and virtualenv.ini.
  • Use persistent, user-owned app-data directories with restrictive permissions when symlinking must remain enabled.
  • On shared build hosts, restrict write access to temporary directories used by virtualenv to the invoking user only.
bash
# Upgrade virtualenv to the patched release
python -m pip install --upgrade "virtualenv>=21.14.10"

# Remove the risky setting from the current shell and user profile
unset VIRTUALENV_SYMLINK_APP_DATA
sed -i '/VIRTUALENV_SYMLINK_APP_DATA/d' ~/.bashrc ~/.zshrc 2>/dev/null

# Verify installed version
virtualenv --version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.