Advisory published

XYZ-2026-00350

virtualenv: a copied CPython library could load standard-library code from outside the environment

Medium severityvirtualenvfixed in 21.15.11
the timeline of this fixpypi · virtualenv · dates in UTC

Flagged 13 hours before the advisory

CyberXYZ reads the changes made to a package's source code. We spotted this security fix on 20 Nov 2026. The maintainers' advisory (GHSA-fj4g-j5mv-5xhv) followed 13 hours later.

13 hoursfrom our flag to the advisory
  1. CyberXYZ flagged the fix
  2. Advisory published

What was wrong

On POSIX shared-library builds of CPython 3.11 and later, an environment created in copy mode could end up with an interpreter that searches for a standard-library zip next to the copied library, outside the environment. virtualenv 21.15.10 added a check for this to its builtin creator, but the stdlib venv creator skipped it.

Impactmedium

If another account on the machine can change that search location, its code runs with the permissions of whoever uses the environment.

Who is affected

virtualenv 21.15.6, 21.15.9 and 21.15.10, for environments created in copy mode on a shared machine where another user can write to the directories above the destination.

What to do

Upgrade to virtualenv 21.15.11 and recreate affected environments. Use --symlinks, or a destination whose parent directories only you or an administrator can change. Where another user could change a search directory later, virtualenv now warns and continues, so read the warning.

pip install --upgrade "virtualenv>=21.15.11"

Published and fixed by the virtualenv maintainers. Advisory: GHSA-fj4g-j5mv-5xhv.

XYZ-2026-00350.json · OSV
{
  "id": "XYZ-2026-00350",
  "summary": "virtualenv: a copied CPython library could load standard-library code from outside the environment",
  "aliases": [
    "GHSA-fj4g-j5mv-5xhv"
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "virtualenv"
      },
      "ranges": [
        {
          "type": "ECOSYSTEM",
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "21.15.11"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "type": "FIX",
      "url": "https://github.com/pypa/virtualenv/commit/21375cf4487baf0448c35b32c289f6a19be549a4"
    },
    {
      "type": "FIX",
      "url": "https://github.com/pypa/virtualenv/commit/82bb8a4786f29a79cf3ffc03ef5e8f5919b1a51c"
    },
    {
      "type": "FIX",
      "url": "https://github.com/pypa/virtualenv/commit/cd1a99039df8f6ebd71db627be9afa503b7b9e71"
    }
  ],
  "credits": [
    {
      "name": "CyberXYZ Security Threat Intel Team",
      "contact": [
        "https://cyberxyz.io"
      ],
      "type": "ANALYST"
    }
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-427"
    ]
  }
}

An excerpt of this record in the OSV format, for tools that read advisories. The full record as JSON.

The bug was found and fixed by the package's maintainers. CyberXYZ flagged the fix in the source and recorded the release that carries it. All CyberXYZ Advisories · The virtualenv report


Think this record is wrong? Tell us; we respond within 2 business days.