{"id":2608,"cve":"CVE-2026-113720","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-113720\/","cwe":"CWE-732","cwe_number":732,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/732","cvss_score":4.4,"published":"2026-10-20","owasp":"A08 Software and Data Integrity Failures","odc":"Checking","cdc":"Missing Check","category":"Configuration Issues","subcategory":"Local File Inclusion (LFI)","scope":"Local","impact":"Privilege Escalation","summary":"Improper file mode handling in virtualenv seeder may expose writable files.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-113720\/","description":"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.","solution":"Upgrade virtualenv to version\u202f21.14.9\u202for newer.","affected_component":"virtualenv","fixed_by_upgrading":true,"vulnerable_code":"import os, shutil, pathlib\n\ndef seed_app_data(cache_dir: str, env_dir: str) -> None:\n    \"\"\"\n    Copy cached package files from ``cache_dir`` into a new virtualenv\n    located at ``env_dir``.\n    \"\"\"\n    src = pathlib.Path(cache_dir)\n    dst = pathlib.Path(env_dir) \/ \"app-data\"\n    dst.mkdir(parents=True, exist_ok=True)\n\n    for pkg_file in src.iterdir():\n        # VULNERABLE: uses shutil.copy preserving source mode, allowing insecure permissions\n        shutil.copy(pkg_file, dst \/ pkg_file.name)\n","patched_code":"import os, shutil, pathlib\n\ndef seed_app_data(cache_dir: str, env_dir: str) -> None:\n    \"\"\"\n    Copy cached package files from ``cache_dir`` into a new virtualenv\n    located at ``env_dir``.\n    \"\"\"\n    src = pathlib.Path(cache_dir)\n    dst = pathlib.Path(env_dir) \/ \"app-data\"\n    dst.mkdir(parents=True, exist_ok=True)\n\n    for pkg_file in src.iterdir():\n        # FIX: copy file then enforce safe permissions (rw-------)\n        dest = dst \/ pkg_file.name\n        shutil.copyfile(pkg_file, dest)\n        os.chmod(dest, 0o600)\n","payload_needed":false,"payload":null,"payload_status":"none","published_fix":[{"repository":"pypa\/virtualenv","commit_url":"https:\/\/github.com\/pypa\/virtualenv\/commit\/35f0b33562790176dd186d0a3c517af3acc7a0e1","commit_subject":"\ud83d\udc1b fix(path): apply current permissions to copied files (#3425)","units":[{"file":"src\/virtualenv\/util\/path\/_sync.py","function":null},{"file":"src\/virtualenv\/util\/path\/_sync.py","function":"copy"},{"file":"src\/virtualenv\/util\/path\/_sync.py","function":"copytree"}]}],"references":null}