CVE-2026-113716: virtualenv: Builtin creation follows linked environment directories
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the builtin creator calls ensuredir() for executable, library, and package directories, and ensuredir() accepts an existing symlink to a directory because exists() follows it. Interpreter creation, seed installation, and activation generation then write through the linked parent outside the requested destination when another local account prepared the tree and the invoking user can access the target. The --clear option removes the planted tree first, while ordinary creation reaches it; arbitrary attacker-selected output bytes are not established. This issue is fixed in version 21.14.9.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
virtualenvto a version that resolves this vulnerability.Fixed in 21.14.9
Event History
Frequently Asked Questions
Who is exposed to this issue?
Users who create environments in a directory tree that another local account can prepare are exposed when they can access the symlink target. The issue requires a locally planted directory structure rather than remote-only access.
What must an attacker do to exploit it?
An attacker must prepare the requested environment tree with existing symlinks to directories. During ordinary environment creation, virtualenv can follow those links and write interpreter, seed-installation, and activation files through the linked parent.
Does using --clear change the outcome?
Yes. The --clear option removes the planted tree before creation, while ordinary creation can reach the attacker-prepared links.
What should be done if an immediate upgrade is not possible?
Use --clear when creating environments in locations where another local account could have prepared the destination tree. Avoid creating environments in attacker-controlled or shared pre-existing directory trees.
Which versions contain the fix?
The issue is fixed in virtualenv version 21.14.9. Versions prior to 21.14.9 are affected.