virtualenv Has TOCTOU Vulnerabilities in Directory Creation
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- Low · Low · Low
- Fix status
- Partial Red Hat: 7 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| pypa | virtualenv | before 20.36.1 | 20.36.1 | Patch available | CNA |
| — | virtualenv (PyPI) | before 20.36.1 | 20.36.1 | Patch available | GHSA-597g-3phw-6986 |
- virtualenv Vendorpypa Affected before 20.36.1 Fixed in 20.36.1 Patch available CNA
- virtualenv (PyPI) Vendor— Affected before 20.36.1 Fixed in 20.36.1 Patch available GHSA-597g-3phw-6986
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:virtualenv:virtualenv:*:*:*:*:*:*:*:* | before 20.36.1 | Vulnerable | Virtualenv |
- cpe:2.3:a:virtualenv:virtualenv:*:*:*:*:*:*:*:* Versions before 20.36.1 Vulnerable ·Virtualenv
Remediation
- Fix · CNA virtualenv (pypa) Fixed in 20.36.1
- Fix · GHSA-597g-3phw-6986 virtualenv (PyPI) Fixed in 20.36.1 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| OpenShift Lightspeed | Affected | No fix yet: Fix deferred |
| OpenShift Service Mesh 2 | Affected | No fix yet: Fix deferred |
| Red Hat Ansible Automation Platform 2 | Affected | No fix yet: Fix deferred |
| Red Hat Enterprise Linux 8 | Affected | No fix yet: Fix deferred |
| Red Hat OpenShift AI (RHOAI) | Affected | No fix yet: Fix deferred |
| Red Hat OpenShift Dev Spaces | Affected | No fix yet: Fix deferred |
| Red Hat Satellite 6 | Affected | No fix yet: Fix deferred |
Timeline
- 2026-10-02 Threatist record created from CVE-2026-22702
- 2026-10-03 Alias added: GHSA-597g-3phw-6986
References
Patch 3
More pypa vulnerabilities
- TI-2025-29803 setuptools has a path traversal vulnerability in PackageIndex.download that leads to Arbitrary File Write CVSS 4.0HIGH 7.7
- TI-2024-05888 Remote Code Execution in pypa/setuptools CVSS 3.0HIGH 8.8
- TI-2026-78525 Shell command injection in virtualenv generated POSIX launchers CVSS 3.1HIGH 7.8
- TI-2026-78526 Command injection in virtualenv bash activation prompt CVSS 4.0HIGH 7.1
- TI-2026-78521 Code injection in virtualenv Xonsh activation script CVSS 4.0HIGH 7.1
- TI-2026-19377 wheel Allows Arbitrary File Permission Modification via Path Traversal CVSS 3.1HIGH 7.1
Sources
- CVE-2026-22702 · CVE Program
- CVE-2026-22702 · NVD
- FIRST EPSS
- GHSA-597g-3phw-6986 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-22702 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences