CVE-2026-113720: virtualenv app-data Copy Seeder Insecure Cached Package File Permissions (CWE-732)
Detects the presence and exploitation potential of CVE-2026-113720, an incorrect-permission-assignment (CWE-732) flaw in the pypa virtualenv app-data copy seeder. Prior to version 21.14.9, the copy seeder uses shutil.copy() to copy cached wheel/package files from the user's app-data cache into newly created virtual environments. shutil.copy() preserves the source file's mode bits instead of applying the current umask, so a cache populated under a permissive umask can produce environment files writable by another local account, letting that account modify cached package code such as pip/__init__.py and have it run as the environment owner. This detection surfaces vulnerable virtualenv installations, creation of virtual environments by affected versions, and world-writable/world-readable files appearing under the virtualenv app-data directory (~/.local/share/virtualenv or the platform appdata path).
Based on GHSA-fc2g-4w5p-6whm, virtualenv app-data copy seeder insecure permissions
Vulnerability Intelligence
Public PoCAffected Software
- Vendor
- virtualenv
- Product
- virtualenv
- Versions
- >= 20.0.0, < 21.14.9
Weakness (CWE)
Timeline
- Disclosed
- October 20, 2026
CVSS
What is CVE-2026-113720 CVE-2026-113720: virtualenv app-data Copy Seeder Insecure Cached Package File Permissions (CWE-732)?
CVE-2026-113720: virtualenv app-data Copy Seeder Insecure Cached Package File Permissions (CWE-732) (CVE-2026-113720) maps to the Privilege Escalation and Initial Access tactics — the adversary is trying to gain higher-level permissions in MITRE ATT&CK.
This page provides production-ready detection logic for CVE-2026-113720: virtualenv app-data Copy Seeder Insecure Cached Package File Permissions (CWE-732), covering the data sources and telemetry it touches: Microsoft Defender for Endpoint, DeviceProcessEvents, DeviceFileEvents. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
// df00tech DF00-7f1da49b28 · https://df00tech.com/detections/CVE-2026-113720 · licence: https://df00tech.com/detections/licence
// Detect vulnerable virtualenv versions and world-writable app-data cache files on monitored hosts
let VulnFloor = "20.0.0";
let FixedVersion = "21.14.9";
union isfuzzy=true
(
DeviceProcessEvents
| where FileName in~ ("python", "python3", "virtualenv", "pip", "pip3")
| where ProcessCommandLine has_any ("virtualenv", "-m virtualenv")
| where ProcessCommandLine has_any ("--copies", "--always-copy", "copies") or ProcessCommandLine has "virtualenv"
| project Timestamp, DeviceId, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessAccountName
| extend Signal = "virtualenv-invocation"
),
(
DeviceFileEvents
| where FolderPath has_any ("/.local/share/virtualenv", "\\virtualenv\\", "/Library/Application Support/virtualenv")
| where FolderPath has_any ("wheel", "pip", "setuptools", "app-data", ".whl")
| project Timestamp, DeviceId, DeviceName, AccountName, FolderPath, FileName, ActionType, InitiatingProcessCommandLine
| extend Signal = "virtualenv-appdata-file"
)
| order by Timestamp desc Surfaces virtualenv environment-creation invocations and file writes under the virtualenv app-data cache directory where CVE-2026-113720 (insecure copy-seeder permissions) manifests. Correlate with inventory of installed virtualenv versions < 21.14.9.
Data Sources
Required Tables
False Positives
- Legitimate CI/CD or developer workflows that create virtualenvs with --copies on single-user build agents
- Patched virtualenv (>= 21.14.9) still writing to the app-data cache with corrected permissions
- Automated tooling (tox, nox, pre-commit) that rebuilds virtual environments frequently
Query fingerprint DF00-7f1da49b28 · licence
Sigma logsource & community rules
The detection logic for CVE-2026-113720: virtualenv app-data Copy Seeder Insecure Cached Package File Permissions (CWE-732) (CVE-2026-113720) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for CVE-2026-113720
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 Install affected virtualenv version
Expected signal: Process creation events for pip install and virtualenv version check; package metadata showing virtualenv 20.25.0.
- Test 2 Create virtualenv with copy seeder populating app-data cache
Expected signal: File creation events under ~/.local/share/virtualenv and /tmp/argus-venv-test; virtualenv process launch.
- Test 3 Detect world-readable/writable cached package files
Expected signal: Filesystem read/stat activity enumerating cache file permissions.
Response Playbook
Triage
- Identify the installed virtualenv version on the affected host(s): run `python -m virtualenv --version` or `pip show virtualenv`; confirm whether it falls in the affected range >= 20.0.0 and < 21.14.9.
- Enumerate the virtualenv app-data cache directory (typically ~/.local/share/virtualenv on Linux, %LOCALAPPDATA%\virtualenv on Windows, ~/Library/Application Support/virtualenv on macOS) and inspect permissions of cached wheel/package files for world-readable or world-writable bits.
- Determine whether the host is multi-user or shared (CI runner, jump host, build server); single-user developer machines carry materially lower risk than shared systems.
- Review whether any virtual environments were seeded from the cache by other users and whether cached package files could have been modified by an unprivileged local account.
Containment
- Upgrade virtualenv to 21.14.9 or later on all affected hosts (`pip install --upgrade 'virtualenv>=21.14.9'`).
- Tighten permissions on the existing app-data cache directory and its contents (e.g. `chmod -R go-rwx ~/.local/share/virtualenv`) and recreate any virtual environments that were seeded from a potentially tampered cache.
- On shared/multi-user hosts, restrict the app-data location to per-user paths and audit who can write to shared cache directories.
Evidence Collection
- Capture the output of `ls -la` (or `icacls`) for the app-data cache directory and all cached package files, recording owner, group and mode bits.
- Collect virtualenv/pip version information and the modification timestamps of cached wheels to establish whether tampering preceded environment creation.
- Preserve process creation and file write telemetry (EDR) showing virtualenv invocations and cache file writes for the investigation window.
Escalation Criteria
- ! Escalate if cached package files on a shared/multi-user host are found world-writable AND were modified by an account other than the cache owner, indicating possible package tampering.
- ! Escalate if any virtual environment seeded from the affected cache was subsequently used to run privileged or service processes, raising the likelihood of local privilege escalation or code execution.
Investigation Guide
Forensic Artifacts
- >
Permission/mode bits and ownership of files under the virtualenv app-data cache directory - >
Modification timestamps of cached .whl/package files vs. the time virtual environments were created - >
virtualenv/pip version metadata (dist-info, RECORD files) in seeded environments
Tuning Guidance
Scope the file-event portion to shared or multi-user hosts (CI runners, jump boxes, build servers) to reduce noise from single-user developer laptops, where permissive cache permissions carry minimal cross-user risk. Suppress hosts confirmed to be running virtualenv >= 21.14.9. Prioritize alerts where the file owner differs from the account that created the environment.
Hunting Queries
Enumerate cached virtualenv wheel files and their permissions across the fleet to locate world-writable caches.
// df00tech DF00-7f1da49b28 · https://df00tech.com/detections/CVE-2026-113720 · licence: https://df00tech.com/detections/licence
DeviceFileEvents | where FolderPath has "/.local/share/virtualenv" and FileName endswith ".whl" | summarize count() by DeviceName, AccountName, FolderPath ``` df00tech DF00-7f1da49b28 · https://df00tech.com/detections/CVE-2026-113720 · licence: https://df00tech.com/detections/licence ```
sourcetype=osquery:results path="*/.local/share/virtualenv/*" | stats values(file_mode) as modes by host, path Atomic Red Team Tests
Install a virtualenv version within the affected range to reproduce the vulnerable copy-seeder behavior in a lab.
Command
python3 -m pip install 'virtualenv==20.25.0' && python3 -m virtualenv --version Cleanup
python3 -m pip install --upgrade 'virtualenv>=21.14.9' Expected Telemetry
Process creation events for pip install and virtualenv version check; package metadata showing virtualenv 20.25.0.
Expected Detection
Inventory/version check flags virtualenv in affected range >= 20.0.0 and < 21.14.9.
Create a virtual environment using the copy seeder, which populates the app-data cache via shutil.copy() and seeds wheels into the new environment.
Command
python3 -m virtualenv --copies /tmp/argus-venv-test && ls -la ~/.local/share/virtualenv/wheel/*/image/*/*/ 2>/dev/null Cleanup
rm -rf /tmp/argus-venv-test Expected Telemetry
File creation events under ~/.local/share/virtualenv and /tmp/argus-venv-test; virtualenv process launch.
Expected Detection
virtualenv invocation and app-data cache file-write signals fire; permission inspection reveals seeder-created files.
Inspect the app-data cache for files with overly permissive permissions representing the CVE-2026-113720 condition.
Command
find ~/.local/share/virtualenv -type f \( -perm -0002 -o -perm -0004 \) -ls 2>/dev/null Cleanup
chmod -R go-rwx ~/.local/share/virtualenv 2>/dev/null || true Expected Telemetry
Filesystem read/stat activity enumerating cache file permissions.
Expected Detection
World-writable/world-readable cache files flagged by the file-permission portion of the detection.
Related Detections
Related Techniques
Same Tactic: Privilege Escalation
Browse by tactic
- Reconnaissance TA0043
- Resource Development TA0042
- Initial Access TA0001
- Execution TA0002
- Persistence TA0003
- Privilege Escalation TA0004
- Stealth TA0005
- Defense Impairment TA0112
- Credential Access TA0006
- Discovery TA0007
- Lateral Movement TA0008
- Collection TA0009
- Command and Control TA0011
- Exfiltration TA0010
- Impact TA0040