Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. virtualenv
  4. ›
  5. CVE-2026-22702

CVE-2026-22702: virtualenv Has TOCTOU Vulnerabilities in Directory Creation

January 13, 2026

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.

Affected versions: All versions up to and including 20.36.1

Affected users: Any user running virtualenv on multi-user systems where untrusted local users have filesystem access to shared temporary directories or where VIRTUALENV_OVERRIDE_APP_DATA points to a user-writable location.

Attack scenarios:

  • Cache poisoning: Attacker corrupts wheels or Python metadata in the cache
  • Information disclosure: Attacker reads sensitive cached data or metadata
  • Lock bypass: Attacker controls lock file semantics to cause concurrent access violations
  • Denial of service: Lock starvation preventing virtualenv operations

References

  • github.com/advisories/GHSA-597g-3phw-6986
  • github.com/pypa/virtualenv
  • github.com/pypa/virtualenv/commit/dec4cec5d16edaf83a00a658f32d1e032661cebc
  • github.com/pypa/virtualenv/pull/3013
  • github.com/pypa/virtualenv/security/advisories/GHSA-597g-3phw-6986
  • nvd.nist.gov/vuln/detail/CVE-2026-22702

Code Behaviors & Features

Detect and mitigate CVE-2026-22702 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 20.36.1

Fixed versions

  • 20.36.1

Solution

Upgrade to version 20.36.1 or above.

Impact 4.5 MEDIUM

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L

Learn more about CVSS

Weakness

  • CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
  • CWE-59: Improper Link Resolution Before File Access ('Link Following')

Source file

pypi/virtualenv/CVE-2026-22702.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:45 +0000.