{"id":2453,"cve":"CVE-2026-102925","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-102925\/","cwe":"CWE-78","cwe_number":78,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/78","cvss_score":7.8,"published":"2026-09-29","owasp":"A03 Injection","odc":"Checking","cdc":"Missing Check","category":"Input Validation and Sanitization","subcategory":"Command Injection","scope":"Local","impact":"Arbitrary Code Execution","summary":"Improper quoting in virtualenv activation scripts leads to code injection.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-102925\/","description":"virtualenv is a tool for creating isolated virtual python environments. Prior to 21.7.13, the generated activate (bash and zsh) and activate.fish scripts place values already escaped by shlex.quote inside an additional quoted context. In the bash and zsh script, a crafted virtual environment path reaches __VIRTUAL_ENV__ when a relocated environment's recorded directory is absent; in the fish script, crafted Tcl or Tk library paths reach __TCL_LIBRARY__ or __TK_LIBRARY__. The surplus quotes can terminate the data-only quoted run and leave shell metacharacters parsed as commands when a user sources the activation script, allowing code execution with that user's privileges. This issue is fixed in version 21.7.13.","solution":"Upgrade virtualenv to version\u202f21.7.13\u202for newer.","affected_component":"virtualenv","fixed_by_upgrading":true,"vulnerable_code":"import shlex\n\ndef generate_activate(env_path: str) -> str:\n    \"\"\"\n    Generate a bash activate script for a virtualenv.\n    The path is quoted twice, leading to command injection.\n    \"\"\"\n    # VULNERABLE: double\u2011quoting allows injected shell metacharacters\n    quoted = shlex.quote(env_path)\n    script = f\"\"\"#!\/usr\/bin\/env bash\n# This file is auto\u2011generated by virtualenv\nVIRTUAL_ENV='{quoted}'\nexport VIRTUAL_ENV\nPATH=\"{quoted}\/bin:$PATH\"\nexport PATH\n\"\"\"\n    return script\n","patched_code":"import shlex\n\ndef generate_activate(env_path: str) -> str:\n    \"\"\"\n    Generate a bash activate script for a virtualenv.\n    The path is quoted only once, preventing injection.\n    \"\"\"\n    # FIX: single quoting of a safely escaped path\n    quoted = shlex.quote(env_path)\n    script = f\"\"\"#!\/usr\/bin\/env bash\n# This file is auto\u2011generated by virtualenv\nVIRTUAL_ENV={quoted}\nexport VIRTUAL_ENV\nPATH={quoted}\/bin:$PATH\nexport PATH\n\"\"\"\n    return script\n","payload_needed":true,"payload":null,"payload_status":"model_refused","published_fix":[],"references":null}