{"vuln_id":"GHSA-fc2g-4w5p-6whm","aliases":["CVE-2026-113720"],"description":"virtualenv: Seeded files retain permissions from an older cache","published_at":"2026-10-20T20:17:18.493000Z","modified_at":"2026-11-18T12:11:01.943005Z","first_seen_at":"2026-11-21T19:15:47.080859Z","severity":"high","severity_source":"cvss","cvss_score":7.3,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H","cwe":["CWE-732"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-fc2g-4w5p-6whm"},"matched_alias":null,"items":[{"id":10751,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-fc2g-4w5p-6whm: virtualenv: Seeded files retain permissions from an older cache","summary":"virtualenv: Seeded files retain permissions from an older cache\n\n## Summary\n\nThe app-data copy seeder uses shutil.copy, which preserves cached file modes independently of the current umask. A cache\npopulated under permissive permissions can therefore produce files with wider access in later environments.\n\nAnthropic's OSS Scanner reported this as `ANT-2026-487MH6OW` in `virtualenv-20261015-005`, received on 15 October 2026.\n\n## Affected area\n\nPermissions of files copied from app-data into a new environment.\n\n## Attacker-controlled input\n\nThe cache must contain files created with broader permissions than the current environment creator intends. Another\naccount must also be able to traverse the new environment and reach those files. A private parent directory prevents\nthat access. No control of a private live cache is assumed.\n\n## Affected code\n\nThe relevant 21.14.8 source is in\n[copy helpers](https://github.com/pypa/virtualenv/blob/a795ab116356afde11039cf2763d77e8a06da738/src/virtualenv/util/path/_sync.py).\n\n## Mechanism\n\nThe default app-data seeder extracts a wheel into a reusable cache and copies its files into later environments with\n`shutil.copy()`. That function applies the cached source mode to each destination file after creating it, overriding the\ncurrent run's umask. If the cache image was built under umask `000`, a later environment created under umask `022` can\nreceive mode-`0666` pip files. The cache may be private while the new environment is reachable by other local accounts.\n\n## Reproduction and evidence\n\nThe scanner created two histories with separate private app-data caches. In the control, the owner's first run used\numask `022`; a later environment had no files writable by another account, and that account could not append to\n`pip/__init__.py`. In the attack history, the first run used umask `000` and the later run still used `022`. The report\ncounted 478 of 493 environment files writable by others. A second unprivileged uid appended a line to pip, and\n`bin/pip --version` ran it as the environment owner. The cache itself remained under a mode-`0700` home in both\nhistories.\n\nAn attacker cannot force the owner's earlier umask through this finding; the attack also needs a traversable\ndestination. A mode-`002` cache can expose group write access under suitable group permissions. The scanner dates\napp-data copy seeding to #1578, first released in 20.0.2. [PR #3425](https://github.com/pypa/virtualenv/pull/3425)\ncreates copied files under a fixed non-writable-by-others policy further restricted by the current umask.\n\n## Attack sequence\n\n```mermaid\nsequenceDiagram\n    participant U as Environment owner\n    participant C as Private app-data cache\n    participant E as Later environment\n    participant A as Other local account\n    U->>C: first seed extraction under umask 000\n    C-->>U: cached pip files have mode 0666\n    U->>E: create environment under umask 022\n    C->>E: shutil.copy reapplies mode 0666\n    A->>E: append code to pip/__init__.py\n    U->>E: run bin/pip --version\n    E-->>U: appended code \n\nAffected: PyPI:virtualenv\n\nFixed in: 21.14.9\n\nReferences:\nhttps://github.com/pypa/virtualenv/security/advisories/GHSA-fc2g-4w5p-6whm\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-113720\nhttps://github.com/pypa/virtualenv/pull/3425\nhttps://github.com/pypa/virtualenv/commit/35f0b33562790176dd186d0a3c517af3acc7a0e1\nhttps://github.com/pypa/virtualenv\nhttps://github.com/pypa/virtualenv/releases/tag/21.14.9","url":"https://osv.dev/vulnerability/GHSA-fc2g-4w5p-6whm","published_at":"2026-10-23T22:23:11Z","updated_at":"2026-11-18T12:11:01.943005Z","fetched_at":"2026-11-21T19:15:55.946150Z","severity":"high","cvss_score":7.3,"epss":0.00182,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"virtualenv","vuln_id":"CVE-2026-113720","vuln_ids":["CVE-2026-113720","BIT-VIRTUALENV-2026-113720","GHSA-FC2G-4W5P-6WHM","PYSEC-2026-4379"],"tags":["osv","pypi","fix-available"],"cluster_id":4103,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10751","html":"https://vulnwatch.ve1ve2.com/item/10751"}},{"id":10752,"source":{"id":"osv","name":"OSV.dev"},"title":"PYSEC-2026-4379: virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the app-data copy seeder uses shutil.copy() to copy cached package fi…","summary":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the app-data copy seeder uses shutil.copy() to copy cached package files into later environments, causing cached source modes to override the current run's umask. A cache populated under a permissive umask can therefore produce files writable by another local account in a later traversable environment, allowing package code such as pip/__init__.py to be modified and executed by the environment owner. The attacker cannot force the earlier umask, and a private destination parent prevents access. This issue is fixed in version 21.14.9.\n\nAffected: PyPI:virtualenv\n\nFixed in: 21.14.9\n\nReferences:\nhttps://github.com/pypa/virtualenv/releases/tag/21.14.9\nhttps://github.com/pypa/virtualenv/commit/35f0b33562790176dd186d0a3c517af3acc7a0e1\nhttps://github.com/pypa/virtualenv/pull/3425\nhttps://github.com/pypa/virtualenv/security/advisories/GHSA-fc2g-4w5p-6whm","url":"https://osv.dev/vulnerability/PYSEC-2026-4379","published_at":"2026-10-20T20:17:18.493000Z","updated_at":"2026-11-18T12:11:01.943005Z","fetched_at":"2026-11-21T19:15:55.946151Z","severity":"high","cvss_score":7.3,"epss":0.00182,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"virtualenv","vuln_id":"CVE-2026-113720","vuln_ids":["CVE-2026-113720","BIT-VIRTUALENV-2026-113720","GHSA-FC2G-4W5P-6WHM","PYSEC-2026-4379"],"tags":["osv","pypi","fix-available"],"cluster_id":4102,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10752","html":"https://vulnwatch.ve1ve2.com/item/10752"}},{"id":3764,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-113720: virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the app-data copy seeder uses shutil.copy() to copy cached package fi…","summary":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.14.9, the app-data copy seeder uses shutil.copy() to copy cached package files into later environments, causing cached source modes to override the current run's umask. A cache populated under a permissive umask can therefore produce files writable by another local account in a later traversable environment, allowing package code such as pip/__init__.py to be modified and executed by the environment owner. The attacker cannot force the earlier umask, and a private destination parent prevents access. This issue is fixed in version 21.14.9.\n\nReferences:\nhttps://github.com/pypa/virtualenv/commit/35f0b33562790176dd186d0a3c517af3acc7a0e1\nhttps://github.com/pypa/virtualenv/pull/3425\nhttps://github.com/pypa/virtualenv/releases/tag/21.14.9\nhttps://github.com/pypa/virtualenv/security/advisories/GHSA-fc2g-4w5p-6whm","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-113720","published_at":"2026-10-20T20:17:18.493000Z","updated_at":"2026-11-17T17:52:17.073000Z","fetched_at":"2026-11-21T19:15:31.479288Z","severity":"high","cvss_score":7.3,"epss":0.00182,"is_kev":false,"has_exploit":true,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-113720","vuln_ids":["CVE-2026-113720","GHSA-FC2G-4W5P-6WHM"],"tags":["CWE-732"],"cluster_id":4102,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/3764","html":"https://vulnwatch.ve1ve2.com/item/3764"}}]}