---
id: CVE-2026-22702
title: >-
  virtualenv: virtualenv: Local attacker can redirect file operations via TOCTOU
  race condition (CVE-2026-22702)
summary: >-
  A flaw was found in virtualenv, a tool for creating isolated virtual Python
  environments. A local attacker can exploit a Time-of-Check-Time-of-Use
  (TOCTOU) race condition during directory creation operations. By performing
  symlink-based at…
severity: medium
cvss: 4.5
cvssVector: 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L'
cvssSource: vendor
cwe: CWE-59
vendor: Red Hat
product: Red Hat OpenShift AI (RHOAI)
affected:
  - openshift_lightspeed
  - openshift_service_mesh 2
  - ansible_automation_platform 2
  - enterprise_linux 8
  - openshift_ai_rhoai
  - openshift_dev_spaces
  - satellite 6
patched:
  - virtualenv 20.36.1
published: '2026-01-10'
updated: '2026-10-15'
sourceUpdated: '2026-10-15T11:33:36+00:00'
source: CSAF
sourceUrl: 'https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-22702.json'
references:
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-22702.json
  - url: 'https://access.redhat.com/security/cve/CVE-2026-22702'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2428441'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2026-22702'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-22702'
  - url: >-
      https://github.com/pypa/virtualenv/commit/dec4cec5d16edaf83a00a658f32d1e032661cebc
  - url: 'https://github.com/pypa/virtualenv/pull/3013'
  - url: 'https://github.com/pypa/virtualenv/security/advisories/GHSA-597g-3phw-6986'
  - url: 'https://github.com/pypa/virtualenv'
tags:
  - csaf
  - vex
  - red-hat
  - osv
  - pip
epss: 0.001
epssPercentile: 0.00865
aliases:
  - GHSA-597g-3phw-6986
  - BIT-virtualenv-2026-22702
  - PYSEC-2026-2009
ecosystem: pip
ingestedAt: '2026-07-08T18:25:45.829Z'
---

## Overview

A flaw was found in virtualenv, a tool for creating isolated virtual Python environments. A local attacker can exploit a Time-of-Check-Time-of-Use (TOCTOU) race condition during directory creation operations. By performing symlink-based attacks, the attacker can redirect virtualenv's application data and lock file operations to locations they control. This could lead to information disclosure or data tampering.

## Vendor advisories

- **Red Hat VEX** · Moderate · affected: OpenShift Lightspeed, OpenShift Service Mesh 2, Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux 8, Red Hat OpenShift AI (RHOAI), Red Hat OpenShift Dev Spaces, … · no fix planned: OpenShift Lightspeed, OpenShift Service Mesh 2, Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux 8, … · updated 2026-10-15 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-22702.json)

**virtualenv: virtualenv: Local attacker can redirect file operations via TOCTOU race condition** — rated Moderate by Red Hat. Released 2026-01-10, updated 2026-10-15.

Affected:

- OpenShift Lightspeed
- OpenShift Service Mesh 2
- Red Hat Ansible Automation Platform 2
- Red Hat Enterprise Linux 8
- Red Hat OpenShift AI (RHOAI)
- Red Hat OpenShift Dev Spaces
- Red Hat Satellite 6

No fix planned:

- OpenShift Lightspeed
- OpenShift Service Mesh 2
- Red Hat Ansible Automation Platform 2
- Red Hat Enterprise Linux 8
- Red Hat OpenShift AI (RHOAI)
- Red Hat OpenShift Dev Spaces
- Red Hat Satellite 6

## Remediation

Fix deferred

Workarounds / mitigations:

- Given that this vulnerability requires local access and exploits a race condition during directory creation, ensuring that `virtualenv` operations are performed in trusted and controlled environments can reduce the risk. Limiting the execution of `virtualenv` by untrusted users or within sandboxed environments can help mitigate potential information disclosure or data tampering.

## Package advisory (CVE-2026-22702)

Affected packages:

- `virtualenv < 20.36.1`

Patched in:

- `virtualenv 20.36.1`

Source: https://osv.dev/vulnerability/GHSA-597g-3phw-6986
