Vulnerability · Published Jan 10, 2026 · Assigned by GitHub_M
CVE-2026-22702virtualenv Has TOCTOU Vulnerabilities in Directory Creation
Medium 4.5
In plain English
A medium-severity race condition in virtualenv from pypa. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.1% (higher than 1% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
virtualenv is a tool for creating isolated virtual python environments. Prior to version 20.36.1, TOCTOU (Time-of-Check-Time-of-Use) vulnerabilities in virtualenv allow local attackers to perform symlink-based attacks on directory creation operations. An attacker with local access can exploit a race condition between directory existence checks and creation to redirect virtualenv's app_data and lock file operations to attacker-controlled locations. This issue has been patched in version 20.36.1.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | python-virtualenv | no fix listed | DEBIAN-CVE-2026-22702 |
| Debian:13 | python-virtualenv | 20.31.2+ds-1+deb13u1 | DEBIAN-CVE-2026-22702 |
| Debian:14 | python-virtualenv | 20.36.1+ds-1 | DEBIAN-CVE-2026-22702 |
| PyPI | virtualenv | 20.36.1 | PYSEC-2026-2009 |
| PyPI | virtualenv | 20.36.1 | GHSA-597g-3phw-6986 |
| Ubuntu:25.10 | python-virtualenv | no fix listed | UBUNTU-CVE-2026-22702 |
| Ubuntu:26.04:LTS | python-virtualenv | no fix listed | UBUNTU-CVE-2026-22702 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| pypa | virtualenv | < 20.36.1 |
Weakness: CWE-59, CWE-362 · Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
References
- https://github.com/pypa/virtualenv/security/advisories/GHSA-597g-3phw-6986 x_refsource_CONFIRM
- https://github.com/pypa/virtualenv/pull/3013 x_refsource_MISC
- https://github.com/pypa/virtualenv/commit/dec4cec5d16edaf83a00a658f32d1e032661cebc x_refsource_MISC