CVE-2026-113724: virtualenv: Deletion recovery can change a symlink target's mode
virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the safedelete() deletion error handler responds to a failed removal by reading mode bits with os.lstat(path) and applying owner-write permission with os.chmod(path, ...), which follows a symlink. A planted link inside a read-only directory can therefore cause a victim-owned target outside the destination that is initially not writable by the invoking user to become broadly writable before the retry fails, provided that user owns the target and can change its mode. Another account can use the widened mode only if it can traverse the target's parent directories; root does not reach the demonstrated failure path, and the operation does not itself read the target. 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 realistically exposed to this issue?
Users running virtualenv versions earlier than 21.14.9 may be exposed when a planted symlink exists inside a read-only directory and points to a victim-owned file outside the deletion destination. The invoking user must own the target and be permitted to change its mode; root does not reach the demonstrated failure path.
What does an attacker need to do to exploit it?
An attacker needs to plant a symlink in the directory being processed such that deletion fails and triggers virtualenv's recovery handler. The symlink must point to a target owned by the user invoking virtualenv that is initially not writable by that user.
What is the practical impact of the permission change?
The recovery handler can make the symlink target broadly writable before the deletion retry fails. A different account can use that widened access only if it can traverse the target's parent directories; the operation does not read the target itself.
What should be done if the affected version is in use?
Upgrade virtualenv to version 21.14.9 or later. Until then, avoid running affected versions against deletion destinations where untrusted users can plant symlinks, particularly within read-only directories.